From: Dan Carpenter Date: Mon, 23 Jul 2012 07:46:28 +0000 (+0300) Subject: openvswitch: potential NULL deref in sample() X-Git-Tag: firefly_0821_release~3680^2~2381^2~11 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5b3e7e6cb5771bedda51cdb6f715d1da8cd9e644;p=firefly-linux-kernel-4.4.55.git openvswitch: potential NULL deref in sample() If there is no OVS_SAMPLE_ATTR_ACTIONS set then "acts_list" is NULL and it leads to a NULL dereference when we call nla_len(acts_list). This is a static checker fix, not something I have seen in testing. Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller --- diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c index f3f96badf5aa..320fa0e6951a 100644 --- a/net/openvswitch/actions.c +++ b/net/openvswitch/actions.c @@ -325,6 +325,9 @@ static int sample(struct datapath *dp, struct sk_buff *skb, } } + if (!acts_list) + return 0; + return do_execute_actions(dp, skb, nla_data(acts_list), nla_len(acts_list), true); }