Netdev List
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jesse Gross <jesse@nicira.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	dev@openvswitch.org, netdev@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: [patch] openvswitch: checking wrong variable in queue_userspace_packet()
Date: Sun, 13 May 2012 21:44:18 +0300	[thread overview]
Message-ID: <20120513184418.GB16541@elgon.mountain> (raw)

"skb" is non-NULL here, for example we dereference it in skb_clone().
The intent was to test "nskb" which was just set.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index fe28562..2c74daa 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -321,7 +321,7 @@ static int queue_userspace_packet(int dp_ifindex, struct sk_buff *skb,
 			return -ENOMEM;
 
 		nskb = __vlan_put_tag(nskb, vlan_tx_tag_get(nskb));
-		if (!skb)
+		if (!nskb)
 			return -ENOMEM;
 
 		nskb->vlan_tci = 0;

             reply	other threads:[~2012-05-13 18:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-13 18:44 Dan Carpenter [this message]
     [not found] ` <20120513184418.GB16541-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
2012-05-13 19:22   ` [patch] openvswitch: checking wrong variable in queue_userspace_packet() Jesse Gross
     [not found]     ` <CAEP_g=_LojOio0E5K_vYBkO3BKdW9F=dDam4zwffyZPbSZJd2Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-13 19:47       ` David Miller

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=20120513184418.GB16541@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=dev@openvswitch.org \
    --cc=jesse@nicira.com \
    --cc=kernel-janitors@vger.kernel.org \
    --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