diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2006-11-16 04:19:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-11-16 14:43:38 -0500 |
commit | 6897083abfb0156b533ab8ac42c47f68c550ca9e (patch) | |
tree | 511eb7ea465123ddac43bbfe1ef8e0ecb721a7f9 /drivers | |
parent | 55aa601e14cbec987fa577a895e9297df1d0a71d (diff) |
[PATCH] dell_rbu: fix error check
platform_device_register_simple() returns error code as pointer when it
fails. The return value should be checked by IS_ERR().
Cc: Abhay Salunke <abhay_salunke@dell.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Matt Domsch <Matt_Domsch@dell.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/firmware/dell_rbu.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/firmware/dell_rbu.c b/drivers/firmware/dell_rbu.c index 08b161798443..fc702e40bd43 100644 --- a/drivers/firmware/dell_rbu.c +++ b/drivers/firmware/dell_rbu.c | |||
@@ -705,17 +705,16 @@ static struct bin_attribute rbu_packet_size_attr = { | |||
705 | 705 | ||
706 | static int __init dcdrbu_init(void) | 706 | static int __init dcdrbu_init(void) |
707 | { | 707 | { |
708 | int rc = 0; | 708 | int rc; |
709 | spin_lock_init(&rbu_data.lock); | 709 | spin_lock_init(&rbu_data.lock); |
710 | 710 | ||
711 | init_packet_head(); | 711 | init_packet_head(); |
712 | rbu_device = | 712 | rbu_device = platform_device_register_simple("dell_rbu", -1, NULL, 0); |
713 | platform_device_register_simple("dell_rbu", -1, NULL, 0); | 713 | if (IS_ERR(rbu_device)) { |
714 | if (!rbu_device) { | ||
715 | printk(KERN_ERR | 714 | printk(KERN_ERR |
716 | "dell_rbu:%s:platform_device_register_simple " | 715 | "dell_rbu:%s:platform_device_register_simple " |
717 | "failed\n", __FUNCTION__); | 716 | "failed\n", __FUNCTION__); |
718 | return -EIO; | 717 | return PTR_ERR(rbu_device); |
719 | } | 718 | } |
720 | 719 | ||
721 | rc = sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_data_attr); | 720 | rc = sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_data_attr); |