From: Milan Dadok <milan@dadok.name>
To: "'Greg Kroah-Hartman'" <gregkh@suse.de>
Cc: <linux-kernel@vger.kernel.org>,
"'Hank Janssen'" <hjanssen@microsoft.com>,
"'Haiyang Zhang'" <haiyangz@microsoft.com>
Subject: [PATCH] 2/3 staging: hv: fix oops in vmbus - netvsc list_head
Date: Wed, 28 Oct 2009 23:23:37 +0100 [thread overview]
Message-ID: <001501ca581d$4c201fb0$e4605f10$@name> (raw)
Remove incorrect list_head usage. Variable of type list_head was used in
some function's arguments as list item.
Signed-off-by: Milan Dadok <milan@dadok.name>
---
diff -uprN -X /usr/src/linux/Documentation/dontdiff
/usr/src/linux-2.6.32-rc5/drivers/staging/hv/NetVsc.c
/usr/src/linux/drivers/staging/hv/NetVsc.c
--- /usr/src/linux-2.6.32-rc5/drivers/staging/hv/NetVsc.c 2009-10-28
18:13:04.000000000 +0100
+++ /usr/src/linux/drivers/staging/hv/NetVsc.c 2009-10-28
17:49:40.000000000 +0100
@@ -1052,7 +1052,7 @@ static void NetVscOnReceive(struct hv_de
*/
spin_lock_irqsave(&netDevice->receive_packet_list_lock, flags);
while (!list_empty(&netDevice->ReceivePacketList)) {
- list_move_tail(&netDevice->ReceivePacketList, &listHead);
+ list_move_tail(netDevice->ReceivePacketList.next,
&listHead);
if (++count == vmxferpagePacket->RangeCount + 1)
break;
}
@@ -1071,7 +1071,7 @@ static void NetVscOnReceive(struct hv_de
/* Return it to the freelist */
spin_lock_irqsave(&netDevice->receive_packet_list_lock,
flags);
for (i = count; i != 0; i--) {
- list_move_tail(&listHead,
+ list_move_tail(listHead.next,
&netDevice->ReceivePacketList);
}
spin_unlock_irqrestore(&netDevice->receive_packet_list_lock,
@@ -1085,8 +1085,7 @@ static void NetVscOnReceive(struct hv_de
}
/* Remove the 1st packet to represent the xfer page packet itself */
- xferpagePacket = list_entry(&listHead, struct xferpage_packet,
- ListEntry);
+ xferpagePacket = (struct xferpage_packet*)listHead.next;
list_del(&xferpagePacket->ListEntry);
/* This is how much we can satisfy */
@@ -1102,8 +1101,7 @@ static void NetVscOnReceive(struct hv_de
/* Each range represents 1 RNDIS pkt that contains 1 ethernet frame
*/
for (i = 0; i < (count - 1); i++) {
- netvscPacket = list_entry(&listHead, struct
hv_netvsc_packet,
- ListEntry);
+ netvscPacket = (struct hv_netvsc_packet*)listHead.next;
list_del(&netvscPacket->ListEntry);
/* Initialize the netvsc packet */
---
next reply other threads:[~2009-10-28 22:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-28 22:23 Milan Dadok [this message]
2009-10-29 0:09 ` [PATCH] 2/3 staging: hv: fix oops in vmbus - netvsc list_head Hank Janssen
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='001501ca581d$4c201fb0$e4605f10$@name' \
--to=milan@dadok.name \
--cc=gregkh@suse.de \
--cc=haiyangz@microsoft.com \
--cc=hjanssen@microsoft.com \
--cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.