summaryrefslogtreecommitdiffstats
path: root/net/openvswitch/actions.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-07-23 09:46:28 +0200
committerDavid S. Miller <davem@davemloft.net>2012-07-23 09:59:54 +0200
commit5b3e7e6cb5771bedda51cdb6f715d1da8cd9e644 (patch)
treef722cb5fa6902c344e5345e3156df61a30f4f6a4 /net/openvswitch/actions.c
parenttcp: dont drop MTU reduction indications (diff)
downloadlinux-5b3e7e6cb5771bedda51cdb6f715d1da8cd9e644.tar.xz
linux-5b3e7e6cb5771bedda51cdb6f715d1da8cd9e644.zip
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 <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch/actions.c')
-rw-r--r--net/openvswitch/actions.c3
1 files changed, 3 insertions, 0 deletions
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);
}