Commit ddacd14e authored by Roel Kluin's avatar Roel Kluin Committed by David S. Miller

mISDN: get_free_devid() failure ignored

dev->id is unsigned so a get_free_devid() error is ignored.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarKarsten Keil <keil@b1-systems.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent db9bb63a
......@@ -214,7 +214,7 @@ get_free_devid(void)
if (!test_and_set_bit(i, (u_long *)&device_ids))
break;
if (i > MAX_DEVICE_ID)
return -1;
return -EBUSY;
return i;
}
......@@ -224,10 +224,10 @@ mISDN_register_device(struct mISDNdevice *dev,
{
int err;
dev->id = get_free_devid();
err = -EBUSY;
if (dev->id < 0)
err = get_free_devid();
if (err < 0)
goto error1;
dev->id = err;
device_initialize(&dev->dev);
if (name && name[0])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment