rcpci45 dereference fix.
Subsystems (2)
drivers/net/rcpci45.c renamed from drivers/net/rcpci45.c~ +2 -1
@@ -129,13 +129,14 @@ rcpci45_remove_one (struct pci_dev *pdev) {struct net_device *dev =pci_get_drvdata (pdev); -PDPA pDpa = dev->priv; +PDPA pDpa;if (!dev) {printk (KERN_ERR "%s: remove non-existent device\n" , dev->name);return ; } + pDpa = dev->priv;RCResetIOP (dev);unregister_netdev (dev);
Quoted 6 lines · Francois Romieu
rcpci45_init_one()must succeed in order forrcpci45_remove_one()to be issued.If
rcpci45_init_one()succeeds, dev can not be NULL.So I'd rather see the "if (!dev) {" test removed instead of this change.
Sure.
Dave
net/rcpci45.c renamed from net/rcpci45.c~ +0 -6
@@ -131,12 +131,6 @@struct net_device *dev =pci_get_drvdata (pdev);PDPA pDpa = dev->priv; -if (!dev) { -printk (KERN_ERR "%s: remove non-existent device\n" , - dev->name); -return ; - } -RCResetIOP (dev);unregister_netdev (dev);free_irq (dev->irq, dev);
Dave Jones <[email protected]> :
Quoted 8 lines
drivers/net/rcpci45.c renamed from drivers/net/rcpci45.c~ +1
-1@@ -129,13 +129,14 @@ rcpci45_remove_one (struct pci_dev *pdev) {struct net_device *dev =pci_get_drvdata (pdev); -PDPA pDpa = dev->priv; +PDPA pDpa;
drivers/net/rcpci45.c line 142
Quoted 10 lines
drivers/net/rcpci45.c renamed from drivers/net/rcpci45.c~ +1
-0if (!dev) {printk (KERN_ERR "%s: remove non-existent device\n" , dev->name);return ; } + pDpa = dev->priv;RCResetIOP (dev);unregister_netdev (dev);
rcpci45_init_one() must succeed in order for rcpci45_remove_one() to be issued.
If rcpci45_init_one() succeeds, dev can not be NULL.
So I'd rather see the "if (!dev) {" test removed instead of this change.
--
Ueimor
Quoted 16 lines · Dave Jones
Quoted 6 lines · Francois Romieu
rcpci45_init_one()must succeed in order forrcpci45_remove_one()to be issued.If
rcpci45_init_one()succeeds, dev can not be NULL.So I'd rather see the "if (!dev) {" test removed instead of this change.
Sure.
Dave
net/rcpci45.c line 139
Quoted 9 lines
net/rcpci45.c renamed from net/rcpci45.c~ +0
-6@@ -131,12 +131,6 @@struct net_device *dev =pci_get_drvdata (pdev);PDPA pDpa = dev->priv; -if (!dev) { -printk (KERN_ERR "%s: remove non-existent device\n" , - dev->name); -return ; - } -
Manually applied, since it's not in standard "patch -sp1" format.
Jeff