Commit 6897083a authored by Akinobu Mita's avatar Akinobu Mita Committed by Linus Torvalds
Browse files

[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 <>
Signed-off-by: default avatarAkinobu Mita <>
Cc: Matt Domsch <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 55aa601e
......@@ -705,17 +705,16 @@ static struct bin_attribute rbu_packet_size_attr = {
static int __init dcdrbu_init(void)
int rc = 0;
int rc;
rbu_device =
platform_device_register_simple("dell_rbu", -1, NULL, 0);
if (!rbu_device) {
rbu_device = platform_device_register_simple("dell_rbu", -1, NULL, 0);
if (IS_ERR(rbu_device)) {
"dell_rbu:%s:platform_device_register_simple "
"failed\n", __FUNCTION__);
return -EIO;
return PTR_ERR(rbu_device);
rc = sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_data_attr);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment