diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2006-10-17 15:25:59 +0900 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-12-04 20:09:13 -0500 |
commit | 5eb5fc97d83ee1f8fcf3490bb81ad14a99fc544c (patch) | |
tree | f09779d3be8c51f57de1e2dbf6b2446d459e6085 /drivers/char/pcmcia/cm4040_cs.c | |
parent | 0517793fa8f98e6f30406b1811ea0312bca3a414 (diff) | |
download | op-kernel-dev-5eb5fc97d83ee1f8fcf3490bb81ad14a99fc544c.zip op-kernel-dev-5eb5fc97d83ee1f8fcf3490bb81ad14a99fc544c.tar.gz |
[PATCH] cm4000_cs: fix return value check
The return value of class_create() need to be checked with IS_ERR().
And register_chrdev() returns errno on failure.
This patch includes these fixes for cm4000_cs and cm4040_cs.
Signed-off-by: Akinbou Mita <akinobu.mita@gmail.com>
Signed-off-by: Harald Welte <laforge@gnumonks.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/char/pcmcia/cm4040_cs.c')
-rw-r--r-- | drivers/char/pcmcia/cm4040_cs.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c index 55cf4be..7368332 100644 --- a/drivers/char/pcmcia/cm4040_cs.c +++ b/drivers/char/pcmcia/cm4040_cs.c @@ -721,14 +721,14 @@ static int __init cm4040_init(void) printk(KERN_INFO "%s\n", version); cmx_class = class_create(THIS_MODULE, "cardman_4040"); - if (!cmx_class) - return -1; + if (IS_ERR(cmx_class)) + return PTR_ERR(cmx_class); major = register_chrdev(0, DEVICE_NAME, &reader_fops); if (major < 0) { printk(KERN_WARNING MODULE_NAME ": could not get major number\n"); - return -1; + return major; } rc = pcmcia_register_driver(&reader_driver); |