Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359349
b: refs/heads/master
c: 80f22b4
h: refs/heads/master
i:
  359347: b9d86dd
v: v3
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Feb 28, 2013
1 parent 188fd2e commit 1dcd135
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cffcd59f15db02b341e50da653860afa0ba11a83
refs/heads/master: 80f22b4430cd5c108a4676803439ecb0c5cfeca1
21 changes: 8 additions & 13 deletions trunk/drivers/infiniband/hw/qib/qib_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1060,22 +1060,23 @@ struct qib_devdata *qib_alloc_devdata(struct pci_dev *pdev, size_t extra)
struct qib_devdata *dd;
int ret;

if (!idr_pre_get(&qib_unit_table, GFP_KERNEL)) {
dd = ERR_PTR(-ENOMEM);
goto bail;
}

dd = (struct qib_devdata *) ib_alloc_device(sizeof(*dd) + extra);
if (!dd) {
dd = ERR_PTR(-ENOMEM);
goto bail;
}

idr_preload(GFP_KERNEL);
spin_lock_irqsave(&qib_devs_lock, flags);
ret = idr_get_new(&qib_unit_table, dd, &dd->unit);
if (ret >= 0)

ret = idr_alloc(&qib_unit_table, dd, 0, 0, GFP_NOWAIT);
if (ret >= 0) {
dd->unit = ret;
list_add(&dd->list, &qib_dev_list);
}

spin_unlock_irqrestore(&qib_devs_lock, flags);
idr_preload_end();

if (ret < 0) {
qib_early_err(&pdev->dev,
Expand Down Expand Up @@ -1180,11 +1181,6 @@ static int __init qlogic_ib_init(void)
* the PCI subsystem.
*/
idr_init(&qib_unit_table);
if (!idr_pre_get(&qib_unit_table, GFP_KERNEL)) {
pr_err("idr_pre_get() failed\n");
ret = -ENOMEM;
goto bail_cq_wq;
}

ret = pci_register_driver(&qib_driver);
if (ret < 0) {
Expand All @@ -1199,7 +1195,6 @@ static int __init qlogic_ib_init(void)

bail_unit:
idr_destroy(&qib_unit_table);
bail_cq_wq:
destroy_workqueue(qib_cq_wq);
bail_dev:
qib_dev_cleanup();
Expand Down

0 comments on commit 1dcd135

Please sign in to comment.