hso: fix disable_net
Subsystems (4)
PATCH 1/1 hso: fix disable_net
The HSO driver incorrectly creates a serial device instead of a net device when disable_net is set. It shouldn't create anything for the network interface.
---
drivers/net/usb/hso.c +3 -3
@@ -2994,10 +2994,10 @@ static int hso_probe(struct usb_interface *interface,case HSO_INTF_BULK :/* It's a regular bulk interface */ -if (((port_spec &HSO_PORT_MASK ) ==HSO_PORT_NETWORK ) && - !disable_net) +if ((port_spec &HSO_PORT_MASK ) ==HSO_PORT_NETWORK ) { +if (!disable_net) hso_dev =hso_create_net_device (interface, port_spec); -else + }else hso_dev =hso_create_bulk_serial_device (interface, port_spec);if (!hso_dev)
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hello.
Quoted 12 lines · Filip Aben
The HSO driver incorrectly creates a serial device instead of a net device when
disable_netis set. It shouldn't create anything for the network interface.Signed-off-by Filip Aben <[email protected]>---
drivers/net/usb/hso.c +0
-0
drivers/net/usb/hso.c static int hso_probe(struct usb_interface *interface, · line 2998
Quoted 7 lines
drivers/net/usb/hso.c +2
-2@@ -2994,10 +2994,10 @@ static int hso_probe(struct usb_interface *interface,case HSO_INTF_BULK :/* It's a regular bulk interface */ -if (((port_spec&HSO_PORT_MASK ) ==HSO_PORT_NETWORK )&& - !disable_net) +if ((port_spec&HSO_PORT_MASK ) ==HSO_PORT_NETWORK ) { +if (!disable_net)
Don't use spaces for indentation.
WBR, Sergei
Quoted 12 lines · Filip Aben
The HSO driver incorrectly creates a serial device instead of a net device when
disable_netis set. It shouldn't create anything for the network interface.Signed-off-by Filip Aben <[email protected]>---
drivers/net/usb/hso.c +0
-0
drivers/net/usb/hso.c static int hso_probe(struct usb_interface *interface, · line 3000
Quoted 10 lines
drivers/net/usb/hso.c +3
-3@@ -2994,10 +2994,10 @@ static int hso_probe(struct usb_interface *interface,case HSO_INTF_BULK :/* It's a regular bulk interface */ -if (((port_spec&HSO_PORT_MASK ) ==HSO_PORT_NETWORK )&& - !disable_net) +if ((port_spec&HSO_PORT_MASK ) ==HSO_PORT_NETWORK ) { +if (!disable_net) hso_dev =hso_create_net_device (interface, port_spec); -else + }else
There should now be {} on the *else* branch too, according to CodingStyle.
drivers/net/usb/hso.c static int hso_probe(struct usb_interface *interface, · line 3003
Quoted 3 lines
drivers/net/usb/hso.c +0
-0hso_dev =hso_create_bulk_serial_device (interface, port_spec);if (!hso_dev)
WBR, Sergei
Quoted 3 lines · Filip Aben
The HSO driver incorrectly creates a serial device instead of a net device when
disable_netis set. It shouldn't create anything for the network interface.
Looks good apart from the indentation issue pointed out by Sergei (you should also
indent the hso_create_net_device line).
As I mentioned in another thread, this was actually suggested about a year ago but was never accepted due to patch corruption (the other two patches submitted as part of that series also seem to have been plain wrong, though):
http://kerneltrap.org/mailarchive/linux-netdev/2009/11/19/6261572
Thanks,
Johan