mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Haiyang Zhang <haiyangz@microsoft.com>
To: haiyangz@microsoft.com, kys@microsoft.com, davem@davemloft.net,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] net/hyperv: Correct the assignment in netvsc_recv_callback()
Date: Sun,  5 Feb 2012 14:13:09 -0800	[thread overview]
Message-ID: <1328479990-1436-2-git-send-email-haiyangz@microsoft.com> (raw)
In-Reply-To: <1328479990-1436-1-git-send-email-haiyangz@microsoft.com>

The first assignment to variable "net" is wrong, but overridden by the
latter assignments. So the bug isn't manifested.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/net/hyperv/netvsc_drv.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 466c58a..0ae7a1a 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -267,13 +267,10 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj,
 int netvsc_recv_callback(struct hv_device *device_obj,
 				struct hv_netvsc_packet *packet)
 {
-	struct net_device *net = dev_get_drvdata(&device_obj->device);
+	struct net_device *net;
 	struct sk_buff *skb;
-	struct netvsc_device *net_device;
-
-	net_device = hv_get_drvdata(device_obj);
-	net = net_device->ndev;
 
+	net = ((struct netvsc_device *)hv_get_drvdata(device_obj))->ndev;
 	if (!net) {
 		netdev_err(net, "got receive callback but net device"
 			" not initialized yet\n");
-- 
1.7.7


  reply	other threads:[~2012-02-05 22:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-05 22:13 [PATCH 1/3] net/hyperv: Convert camel cased variables in rndis_filter.c to lower cases Haiyang Zhang
2012-02-05 22:13 ` Haiyang Zhang [this message]
2012-02-05 22:45   ` [PATCH 2/3] net/hyperv: Correct the assignment in netvsc_recv_callback() David Miller
2012-02-05 22:13 ` [PATCH 3/3] net/hyperv: Remove the unnecessary memset in rndis_filter_send() Haiyang Zhang
2012-02-05 22:46   ` David Miller
2012-02-05 22:13 ` [PATCH 1/3] net/hyperv: Convert camel cased variables in rndis_filter.c to lower cases Jesper Juhl
2012-02-05 22:45 ` 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=1328479990-1436-2-git-send-email-haiyangz@microsoft.com \
    --to=haiyangz@microsoft.com \
    --cc=davem@davemloft.net \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®