Re: rcpci45 dereference fix.

From: Francois Romieu
Date: Fri Apr 16 2004 - 17:42:16 EST


Dave Jones <davej@xxxxxxxxxx> :
> --- linux-2.6.5/drivers/net/rcpci45.c~ 2004-04-16 22:22:22.000000000 +0100
> +++ linux-2.6.5/drivers/net/rcpci45.c 2004-04-16 22:23:01.000000000 +0100
> @@ -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);

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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/