Re: rcpci45 dereference fix.

Francois Romieu
2004-04-16T22:38:35Z

Dave Jones <davej@redhat.com> :
> --- 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