hso.c hso_net_open bugfix
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 7 lines · Denis Joseph Barrow
Hi Paulus & others,
Sorry I nearly completely agree with you the code can be left as is Howevernetdev_privcheck is superflous from my understanding of the code, admittedly if they changed thenetdev_privfunction the check might become valid.
I agree with you that odev checks in hso_net_open and hso_net_tx_timeout are pointless and should be removed.
Please add [email protected] mailing list also.
Quoted 40 lines
Admittedly
dev_openwould crash if dev!=NULL so I agree with you it must be checked further up the stack.Quoted 23 lines · Paulius Zaleckas
Quoted 2 lines · Denis Joseph Barrow
netdev_privwill return a non NULL pointer even if thenet_deviceis NULL & cause a crash without this fix.Wrong. If
net_devicewill be NULLhso_net_openwon't get called.Quoted 17 lines
Signed-off-by: Denis Joseph Barrow <D.Barow-x9gZzRpC1QbQT0dZR+AlfA-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org>
---
Index:linux-2.6.27-rc3.patch/drivers/net/usb/hso.c
===================================================================
---linux-2.6.27-rc3.patch.orig/drivers/net/usb/hso.c2008-08-20
12:12:28.000000000 +0200
+++linux-2.6.27-rc3.patch/drivers/net/usb/hso.c2008-08-20
12:26:35.000000000 +0200(quoted diff) +1
-1@@ -611,14 +611,12 @@ /* called when net interface is brought up by ifconfig */ static int hso_net_open(struct net_device *net) { - struct hso_net *odev = netdev_priv(net); + struct hso_net *odev; unsigned long flags = 0;Quoted 5 lines
Review line 620
Quoted 5 lines
(quoted diff) +1
-3- if (!odev) { - dev_err(&net->dev, "No net device !\n"); + if (!net) return -ENODEV; - }--
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