提交 1a8ceafc 编写于 作者: D Dominik Brodowski 提交者: Linus Torvalds

[PATCH] pcmcia: properly handle all errors of register_chrdev

register_chrdev() can return errors (negative) other then -EBUSY, so check
for any negative error code.
Signed-off-by: NRandy Dunlap <rdunlap@xenotime.net>
Signed-off-by: NDominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 a9a55243
......@@ -760,9 +760,9 @@ void __init pcmcia_setup_ioctl(void) {
/* Set up character device for user mode clients */
i = register_chrdev(0, "pcmcia", &ds_fops);
if (i == -EBUSY)
if (i < 0)
printk(KERN_NOTICE "unable to find a free device # for "
"Driver Services\n");
"Driver Services (error=%d)\n", i);
else
major_dev = i;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册