提交 ddacd14e 编写于 作者: R Roel Kluin 提交者: David S. Miller

mISDN: get_free_devid() failure ignored

dev->id is unsigned so a get_free_devid() error is ignored.
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NKarsten Keil <keil@b1-systems.de>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 db9bb63a
...@@ -214,7 +214,7 @@ get_free_devid(void) ...@@ -214,7 +214,7 @@ get_free_devid(void)
if (!test_and_set_bit(i, (u_long *)&device_ids)) if (!test_and_set_bit(i, (u_long *)&device_ids))
break; break;
if (i > MAX_DEVICE_ID) if (i > MAX_DEVICE_ID)
return -1; return -EBUSY;
return i; return i;
} }
...@@ -224,10 +224,10 @@ mISDN_register_device(struct mISDNdevice *dev, ...@@ -224,10 +224,10 @@ mISDN_register_device(struct mISDNdevice *dev,
{ {
int err; int err;
dev->id = get_free_devid(); err = get_free_devid();
err = -EBUSY; if (err < 0)
if (dev->id < 0)
goto error1; goto error1;
dev->id = err;
device_initialize(&dev->dev); device_initialize(&dev->dev);
if (name && name[0]) if (name && name[0])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册