Commit 92ec0893 authored by Milan Dadok's avatar Milan Dadok Committed by Greg Kroah-Hartman

Staging: hv: fix oops in vmbus - netvsc list_head

Remove incorrect list_head usage. Variable of type list_head was used in
some function's arguments as list item.
Signed-off-by: default avatarMilan Dadok <milan@dadok.name>
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9fb5cce4
...@@ -1052,7 +1052,7 @@ static void NetVscOnReceive(struct hv_device *Device, ...@@ -1052,7 +1052,7 @@ static void NetVscOnReceive(struct hv_device *Device,
*/ */
spin_lock_irqsave(&netDevice->receive_packet_list_lock, flags); spin_lock_irqsave(&netDevice->receive_packet_list_lock, flags);
while (!list_empty(&netDevice->ReceivePacketList)) { while (!list_empty(&netDevice->ReceivePacketList)) {
list_move_tail(&netDevice->ReceivePacketList, &listHead); list_move_tail(netDevice->ReceivePacketList.next, &listHead);
if (++count == vmxferpagePacket->RangeCount + 1) if (++count == vmxferpagePacket->RangeCount + 1)
break; break;
} }
...@@ -1071,7 +1071,7 @@ static void NetVscOnReceive(struct hv_device *Device, ...@@ -1071,7 +1071,7 @@ static void NetVscOnReceive(struct hv_device *Device,
/* Return it to the freelist */ /* Return it to the freelist */
spin_lock_irqsave(&netDevice->receive_packet_list_lock, flags); spin_lock_irqsave(&netDevice->receive_packet_list_lock, flags);
for (i = count; i != 0; i--) { for (i = count; i != 0; i--) {
list_move_tail(&listHead, list_move_tail(listHead.next,
&netDevice->ReceivePacketList); &netDevice->ReceivePacketList);
} }
spin_unlock_irqrestore(&netDevice->receive_packet_list_lock, spin_unlock_irqrestore(&netDevice->receive_packet_list_lock,
...@@ -1085,8 +1085,7 @@ static void NetVscOnReceive(struct hv_device *Device, ...@@ -1085,8 +1085,7 @@ static void NetVscOnReceive(struct hv_device *Device,
} }
/* Remove the 1st packet to represent the xfer page packet itself */ /* Remove the 1st packet to represent the xfer page packet itself */
xferpagePacket = list_entry(&listHead, struct xferpage_packet, xferpagePacket = (struct xferpage_packet*)listHead.next;
ListEntry);
list_del(&xferpagePacket->ListEntry); list_del(&xferpagePacket->ListEntry);
/* This is how much we can satisfy */ /* This is how much we can satisfy */
...@@ -1102,8 +1101,7 @@ static void NetVscOnReceive(struct hv_device *Device, ...@@ -1102,8 +1101,7 @@ static void NetVscOnReceive(struct hv_device *Device,
/* Each range represents 1 RNDIS pkt that contains 1 ethernet frame */ /* Each range represents 1 RNDIS pkt that contains 1 ethernet frame */
for (i = 0; i < (count - 1); i++) { for (i = 0; i < (count - 1); i++) {
netvscPacket = list_entry(&listHead, struct hv_netvsc_packet, netvscPacket = (struct hv_netvsc_packet*)listHead.next;
ListEntry);
list_del(&netvscPacket->ListEntry); list_del(&netvscPacket->ListEntry);
/* Initialize the netvsc packet */ /* Initialize the netvsc packet */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment