diff options
author | Ralph Campbell <ralph.campbell@qlogic.com> | 2010-07-01 16:25:45 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2010-07-06 17:14:04 -0400 |
commit | 756a33b8dc3ed5c27685a130339de8a894d528a7 (patch) | |
tree | 1434ca4afa40f03d935b6563a4f4acdd4aef24bb | |
parent | 950aff53949268eec4b0f2bd49f700f9585698f7 (diff) |
IB/qib: Clean up properly if qib_init() fails
If qib_init() fails, the driver fails to free memory, unregister
device files, and unregister with the PCIe framework. The driver will
unload without error but a subsequent driver load will cause the
system to panic. This was found by changing the 7220 code to load the
serdes microcode separately and not installing the microcode file.
Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r-- | drivers/infiniband/hw/qib/qib_init.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/qib/qib_init.c b/drivers/infiniband/hw/qib/qib_init.c index 7831ff835d15..a873dd596e81 100644 --- a/drivers/infiniband/hw/qib/qib_init.c +++ b/drivers/infiniband/hw/qib/qib_init.c | |||
@@ -1289,8 +1289,18 @@ static int __devinit qib_init_one(struct pci_dev *pdev, | |||
1289 | 1289 | ||
1290 | if (qib_mini_init || initfail || ret) { | 1290 | if (qib_mini_init || initfail || ret) { |
1291 | qib_stop_timers(dd); | 1291 | qib_stop_timers(dd); |
1292 | flush_scheduled_work(); | ||
1292 | for (pidx = 0; pidx < dd->num_pports; ++pidx) | 1293 | for (pidx = 0; pidx < dd->num_pports; ++pidx) |
1293 | dd->f_quiet_serdes(dd->pport + pidx); | 1294 | dd->f_quiet_serdes(dd->pport + pidx); |
1295 | if (qib_mini_init) | ||
1296 | goto bail; | ||
1297 | if (!j) { | ||
1298 | (void) qibfs_remove(dd); | ||
1299 | qib_device_remove(dd); | ||
1300 | } | ||
1301 | if (!ret) | ||
1302 | qib_unregister_ib_device(dd); | ||
1303 | qib_postinit_cleanup(dd); | ||
1294 | if (initfail) | 1304 | if (initfail) |
1295 | ret = initfail; | 1305 | ret = initfail; |
1296 | goto bail; | 1306 | goto bail; |