lkml.org 
[lkml]   [2004]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: rcpci45 dereference fix.
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.033 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site