Skip to contentSkip to conversation

net: asix: add missing flag to struct driver_info

PATCH RESEND In review Emil Goode 2 participants 2 messages Feb 13, 2014 – Feb 14, 2014

Subsystems (3)
lore
Share & tools
lore

Emil Goode

author
#0 lore raw

PATCH RESEND 1/1 net: asix: add missing flag to struct driver_info

The struct driver_info ax88178_info is assigned the function asix_rx_fixup_common as it's rx_fixup callback. This means that FLAG_MULTI_PACKET must be set as this function is cloning the data and calling usbnet_skb_return. Not setting this flag leads to usbnet_skb_return beeing called a second time from within the rx_process function in the usbnet module.

---
 drivers/net/usb/asix_devices.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/usb/asix_devices.c +2 -1
index 9765a7d..5d19409 100644
@@ -917,7 +917,8 @@ static const struct driver_info ax88178_info = {
 	.status = asix_status,
 	.link_reset = ax88178_link_reset,
 	.reset = ax88178_reset,
-	.flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR,
+	.flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR |
+		 FLAG_MULTI_PACKET,
 	.rx_fixup = asix_rx_fixup_common,
 	.tx_fixup = asix_tx_fixup,
 };
Signature · 1 line
1.7.10.4
maintainer
#1 lore raw

From: Emil Goode <[email protected]>
Date: Thu, 13 Feb 2014 19:30:39 +0100

Quoted 9 lines

The struct driver_info ax88178_info is assigned the function asix_rx_fixup_common as it's rx_fixup callback. This means that FLAG_MULTI_PACKET must be set as this function is cloning the data and calling usbnet_skb_return. Not setting this flag leads to usbnet_skb_return beeing called a second time from within the rx_process function in the usbnet module.

Applied and queued up for -stable.

It would be great if there were some way to validate these callback flags requirements and catch such errors.