diff mbox

[net-next] vmxnet3: use initialized skb pointer to set hash

Message ID 1387541817-7877-1-git-send-email-mschmidt@redhat.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Michal Schmidt Dec. 20, 2013, 12:16 p.m. UTC
The recent conversion to skb_set_hash() was incorrect. 'skb' is
uninitialized at this point.

Fixes: 0b6807034791 ('net: vmxnet3 calls skb_set_hash')
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
---
 drivers/net/vmxnet3/vmxnet3_drv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Tom Herbert Dec. 20, 2013, 8:30 p.m. UTC | #1
Acked-by: Tom Herbert <therbert@google.com>

On Fri, Dec 20, 2013 at 4:16 AM, Michal Schmidt <mschmidt@redhat.com> wrote:
> The recent conversion to skb_set_hash() was incorrect. 'skb' is
> uninitialized at this point.
>
> Fixes: 0b6807034791 ('net: vmxnet3 calls skb_set_hash')
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
> ---
>  drivers/net/vmxnet3/vmxnet3_drv.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
> index c0eab72..3be786f 100644
> --- a/drivers/net/vmxnet3/vmxnet3_drv.c
> +++ b/drivers/net/vmxnet3/vmxnet3_drv.c
> @@ -1235,7 +1235,8 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
>  #ifdef VMXNET3_RSS
>                         if (rcd->rssType != VMXNET3_RCD_RSS_TYPE_NONE &&
>                             (adapter->netdev->features & NETIF_F_RXHASH))
> -                               skb_set_hash(skb, le32_to_cpu(rcd->rssHash),
> +                               skb_set_hash(ctx->skb,
> +                                            le32_to_cpu(rcd->rssHash),
>                                              PKT_HASH_TYPE_L3);
>  #endif
>                         skb_put(ctx->skb, rcd->len);
> --
> 1.8.4.2
>
--
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 Dec. 26, 2013, 6:55 p.m. UTC | #2
From: Michal Schmidt <mschmidt@redhat.com>
Date: Fri, 20 Dec 2013 13:16:57 +0100

> The recent conversion to skb_set_hash() was incorrect. 'skb' is
> uninitialized at this point.
> 
> Fixes: 0b6807034791 ('net: vmxnet3 calls skb_set_hash')
> Signed-off-by: Michal Schmidt <mschmidt@redhat.com>

Applied, thank you.
--
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
diff mbox

Patch

diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index c0eab72..3be786f 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -1235,7 +1235,8 @@  vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
 #ifdef VMXNET3_RSS
 			if (rcd->rssType != VMXNET3_RCD_RSS_TYPE_NONE &&
 			    (adapter->netdev->features & NETIF_F_RXHASH))
-				skb_set_hash(skb, le32_to_cpu(rcd->rssHash),
+				skb_set_hash(ctx->skb,
+					     le32_to_cpu(rcd->rssHash),
 					     PKT_HASH_TYPE_L3);
 #endif
 			skb_put(ctx->skb, rcd->len);