提交 b0ff7c20 编写于 作者: B Bryan O'Sullivan 提交者: Roland Dreier

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: NBryan O'Sullivan <bos@pathscale.com>
Signed-off-by: NRoland Dreier <rolandd@cisco.com>
上级 94b8d9f9
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册