aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAndy Zhou <azhou@nicira.com>2014-07-17 18:17:54 -0400
committerPravin B Shelar <pshelar@nicira.com>2014-07-24 12:37:22 -0400
commitd9e0ecb81417c34ef8c02a6880d23c362300cda0 (patch)
treede97db2013ec2a68fe663d855f067572bff9fa82 /net
parent651887b0c22cffcfce7eb9c29ee23ffb105bdb0b (diff)
openvswitch: Add skb_clone NULL check for the sampling action.
Fix a bug where skb_clone() NULL check is missing in sample action implementation. Signed-off-by: Andy Zhou <azhou@nicira.com> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Diffstat (limited to 'net')
-rw-r--r--net/openvswitch/actions.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index 794a96f6b8d9..fe5cda0deb39 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -477,6 +477,8 @@ static int sample(struct datapath *dp, struct sk_buff *skb,
477 skb_get(skb); 477 skb_get(skb);
478 } else { 478 } else {
479 sample_skb = skb_clone(skb, GFP_ATOMIC); 479 sample_skb = skb_clone(skb, GFP_ATOMIC);
480 if (!sample_skb) /* Skip sample action when out of memory. */
481 return 0;
480 } 482 }
481 483
482 /* Note that do_execute_actions() never consumes skb. 484 /* Note that do_execute_actions() never consumes skb.