From 5b3e7e6cb5771bedda51cdb6f715d1da8cd9e644 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 23 Jul 2012 10:46:28 +0300 Subject: 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 --- net/openvswitch/actions.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'net/openvswitch') diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c index f3f96badf5a..320fa0e6951 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); } -- cgit v1.2.3