Skip to content

Commit

Permalink
[PATCH] pcmcia: properly handle all errors of register_chrdev
Browse files Browse the repository at this point in the history
register_chrdev() can return errors (negative) other then -EBUSY, so check
for any negative error code.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Dominik Brodowski authored and Linus Torvalds committed Jun 28, 2005
1 parent a9a5524 commit 1a8ceaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pcmcia/pcmcia_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 1a8ceaf

Please sign in to comment.