datapath: add skb_clone NULL check for the sampling action.
authorAndy Zhou <azhou@nicira.com>
Thu, 10 Jul 2014 07:49:06 +0000 (00:49 -0700)
committerAndy Zhou <azhou@nicira.com>
Thu, 10 Jul 2014 21:58:56 +0000 (14:58 -0700)
Fix a bug where skb_clone() NULL check is missing in sample action
implementation.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
datapath/actions.c

index caf432e..5c0e2b7 100644 (file)
@@ -576,6 +576,9 @@ static int sample(struct datapath *dp, struct sk_buff *skb,
                skb_get(skb);
        } else {
                sample_skb = skb_clone(skb, GFP_ATOMIC);
+               if (!sample_skb)
+                       /* Skip the sample action when out of memory. */
+                       return 0;
        }
 
        /* Note that do_execute_actions() never consumes skb.