diff options
author | Bryan O'Sullivan <bos@pathscale.com> | 2006-05-23 11:32:33 -0700 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-05-23 13:27:06 -0700 |
commit | b0ff7c2005f7ec8dec10fb15e62b8e1acc172bbf (patch) | |
tree | d62bf6616d98ef73a941d7bbfbe1ebd5d1621d40 /drivers/infiniband | |
parent | 94b8d9f98d7f535037eb9845b81396f667b4f727 (diff) | |
download | talos-op-linux-b0ff7c2005f7ec8dec10fb15e62b8e1acc172bbf.tar.gz talos-op-linux-b0ff7c2005f7ec8dec10fb15e62b8e1acc172bbf.zip |
IB/ipath: fix NULL dereference during cleanup
Fix NULL deref due to pcidev being clobbered before dd->ipath_f_cleanup()
was called.
Signed-off-by: Bryan O'Sullivan <bos@pathscale.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_driver.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c index 3697edafd6d2..dddcdae736ac 100644 --- a/drivers/infiniband/hw/ipath/ipath_driver.c +++ b/drivers/infiniband/hw/ipath/ipath_driver.c @@ -1905,19 +1905,19 @@ static void __exit infinipath_cleanup(void) } else ipath_dbg("irq is 0, not doing free_irq " "for unit %u\n", dd->ipath_unit); - dd->pcidev = NULL; - } - /* - * we check for NULL here, because it's outside the kregbase - * check, and we need to call it after the free_irq. Thus - * it's possible that the function pointers were never - * initialized. - */ - if (dd->ipath_f_cleanup) - /* clean up chip-specific stuff */ - dd->ipath_f_cleanup(dd); + /* + * we check for NULL here, because it's outside + * the kregbase check, and we need to call it + * after the free_irq. Thus it's possible that + * the function pointers were never initialized. + */ + if (dd->ipath_f_cleanup) + /* clean up chip-specific stuff */ + dd->ipath_f_cleanup(dd); + dd->pcidev = NULL; + } spin_lock_irqsave(&ipath_devs_lock, flags); } |