netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pravin B Shelar <pshelar@nicira.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Andy Zhou <azhou@nicira.com>,
	Pravin B Shelar <pshelar@nicira.com>
Subject: [PATCH 10/11] openvswitch: Add skb_clone NULL check in the recirc action.
Date: Sun, 13 Jul 2014 17:14:02 -0700	[thread overview]
Message-ID: <1405296842-3910-1-git-send-email-pshelar@nicira.com> (raw)

From: Andy Zhou <azhou@nicira.com>

The main change is to fix a bug where the NULL check after skb clone()
call is missing.  The fix is to return 0 whenever skb_clone()
failed to create a clone so that we can continue with rest of actions.

Reported-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
---
 net/openvswitch/actions.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index 2b11473..5920512 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -624,10 +624,13 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
 				break;
 			}
 
-			if (!last_action(a, rem))
+			if (!last_action(a, rem)) {
 				recirc_skb = skb_clone(skb, GFP_ATOMIC);
-			else
+				if (!recirc_skb)
+					return 0;
+			} else {
 				recirc_skb = skb;
+			}
 
 			__this_cpu_inc(net_xmit_recursion);
 			err = execute_recirc(dp, recirc_skb, a);
-- 
1.9.3

                 reply	other threads:[~2014-07-14  0:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1405296842-3910-1-git-send-email-pshelar@nicira.com \
    --to=pshelar@nicira.com \
    --cc=azhou@nicira.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).