From: Dan Carpenter Date: Mon, 23 Jul 2012 07:46:28 +0000 (+0300) Subject: openvswitch: potential NULL deref in sample() X-Git-Tag: v3.6-rc1~125^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5b3e7e6cb5771bedda51cdb6f715d1da8cd9e644;p=platform%2Fkernel%2Flinux-3.10.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 f3f96ba..320fa0e 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); }