Patchwork openvswitch: checking wrong variable in queue_userspace_packet()

login
register
mail settings
Submitter Dan Carpenter
Date May 13, 2012, 6:44 p.m.
Message ID <20120513184418.GB16541@elgon.mountain>
Download mbox | patch
Permalink /patch/158854/
State Accepted
Delegated to: David Miller
Headers show

Comments

Dan Carpenter - May 13, 2012, 6:44 p.m.
"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>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jesse Gross - May 13, 2012, 7:22 p.m.
On Sun, May 13, 2012 at 11:44 AM, Dan Carpenter
<dan.carpenter@oracle.com> wrote:
> "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>

Thanks Dan.

Acked-by: Jesse Gross <jesse@nicira.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - May 13, 2012, 7:47 p.m.
From: Jesse Gross <jesse@nicira.com>
Date: Sun, 13 May 2012 12:22:29 -0700

> On Sun, May 13, 2012 at 11:44 AM, Dan Carpenter
> <dan.carpenter@oracle.com> wrote:
>> "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>
> 
> Thanks Dan.
> 
> Acked-by: Jesse Gross <jesse@nicira.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

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;