Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359346
b: refs/heads/master
c: 5c213f8
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Feb 28, 2013
1 parent bb99196 commit 7ef6124
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 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: cbbbce1de2763cdf923b0e85c1a13877a6b61025
refs/heads/master: 5c213f86417b264b38b279def3363811c2be54f0
16 changes: 4 additions & 12 deletions trunk/drivers/infiniband/hw/ipath/ipath_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,28 +194,25 @@ static struct ipath_devdata *ipath_alloc_devdata(struct pci_dev *pdev)
struct ipath_devdata *dd;
int ret;

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

dd = vzalloc(sizeof(*dd));
if (!dd) {
dd = ERR_PTR(-ENOMEM);
goto bail;
}
dd->ipath_unit = -1;

idr_preload(GFP_KERNEL);
spin_lock_irqsave(&ipath_devs_lock, flags);

ret = idr_get_new(&unit_table, dd, &dd->ipath_unit);
ret = idr_alloc(&unit_table, dd, 0, 0, GFP_NOWAIT);
if (ret < 0) {
printk(KERN_ERR IPATH_DRV_NAME
": Could not allocate unit ID: error %d\n", -ret);
ipath_free_devdata(pdev, dd);
dd = ERR_PTR(ret);
goto bail_unlock;
}
dd->ipath_unit = ret;

dd->pcidev = pdev;
pci_set_drvdata(pdev, dd);
Expand All @@ -224,7 +221,7 @@ static struct ipath_devdata *ipath_alloc_devdata(struct pci_dev *pdev)

bail_unlock:
spin_unlock_irqrestore(&ipath_devs_lock, flags);

idr_preload_end();
bail:
return dd;
}
Expand Down Expand Up @@ -2503,11 +2500,6 @@ static int __init infinipath_init(void)
* the PCI subsystem.
*/
idr_init(&unit_table);
if (!idr_pre_get(&unit_table, GFP_KERNEL)) {
printk(KERN_ERR IPATH_DRV_NAME ": idr_pre_get() failed\n");
ret = -ENOMEM;
goto bail;
}

ret = pci_register_driver(&ipath_driver);
if (ret < 0) {
Expand Down

0 comments on commit 7ef6124

Please sign in to comment.