Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d9e0ecb8 authored by Andy Zhou's avatar Andy Zhou Committed by Pravin B Shelar
Browse files

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: default avatarAndy Zhou <azhou@nicira.com>
Signed-off-by: default avatarPravin B Shelar <pshelar@nicira.com>
parent 651887b0
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -477,6 +477,8 @@ static int sample(struct datapath *dp, struct sk_buff *skb,
		skb_get(skb);
		skb_get(skb);
	} else {
	} else {
		sample_skb = skb_clone(skb, GFP_ATOMIC);
		sample_skb = skb_clone(skb, GFP_ATOMIC);
		if (!sample_skb) /* Skip sample action when out of memory. */
			return 0;
	}
	}


	/* Note that do_execute_actions() never consumes skb.
	/* Note that do_execute_actions() never consumes skb.