Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 184955
b: refs/heads/master
c: dd08f70
h: refs/heads/master
i:
  184953: 4fba7af
  184951: 09d1077
v: v3
  • Loading branch information
Alexander Chiang authored and Roland Dreier committed Feb 24, 2010
1 parent dd018fa commit 956305c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 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: d3f2c67f2d10675f45b0d9257269420e9f59aa1a
refs/heads/master: dd08f702dd773004b81aeddcd120b052a42710c3
12 changes: 7 additions & 5 deletions trunk/drivers/infiniband/core/ucm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,7 @@ static DEVICE_ATTR(ibdev, S_IRUGO, show_ibdev, NULL);

static void ib_ucm_add_one(struct ib_device *device)
{
int devnum;
struct ib_ucm_device *ucm_dev;

if (!device->alloc_ucontext ||
Expand All @@ -1251,16 +1252,17 @@ static void ib_ucm_add_one(struct ib_device *device)

ucm_dev->ib_dev = device;

ucm_dev->devnum = find_first_zero_bit(dev_map, IB_UCM_MAX_DEVICES);
if (ucm_dev->devnum >= IB_UCM_MAX_DEVICES)
devnum = find_first_zero_bit(dev_map, IB_UCM_MAX_DEVICES);
if (devnum >= IB_UCM_MAX_DEVICES)
goto err;

set_bit(ucm_dev->devnum, dev_map);
ucm_dev->devnum = devnum;
set_bit(devnum, dev_map);

cdev_init(&ucm_dev->cdev, &ucm_fops);
ucm_dev->cdev.owner = THIS_MODULE;
kobject_set_name(&ucm_dev->cdev.kobj, "ucm%d", ucm_dev->devnum);
if (cdev_add(&ucm_dev->cdev, IB_UCM_BASE_DEV + ucm_dev->devnum, 1))
if (cdev_add(&ucm_dev->cdev, IB_UCM_BASE_DEV + devnum, 1))
goto err;

ucm_dev->dev.class = &cm_class;
Expand All @@ -1281,7 +1283,7 @@ static void ib_ucm_add_one(struct ib_device *device)
device_unregister(&ucm_dev->dev);
err_cdev:
cdev_del(&ucm_dev->cdev);
clear_bit(ucm_dev->devnum, dev_map);
clear_bit(devnum, dev_map);
err:
kfree(ucm_dev);
return;
Expand Down

0 comments on commit 956305c

Please sign in to comment.