[PATCH] enclosure: fix error path - actually return ERR_PTR() on error
From: Jani Nikula
Date: Fri Mar 12 2010 - 08:51:17 EST
Signed-off-by: Jani Nikula <ext-jani.1.nikula@xxxxxxxxx>
---
NOTE: I'm afraid I'm unable to test this; please consider this more a
bug report than a complete patch.
---
drivers/misc/enclosure.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c
index 1eac626..2979927 100644
--- a/drivers/misc/enclosure.c
+++ b/drivers/misc/enclosure.c
@@ -285,7 +285,7 @@ enclosure_component_register(struct enclosure_device *edev,
err = device_register(cdev);
if (err)
- ERR_PTR(err);
+ return ERR_PTR(err);
return ecomp;
}
--
1.6.5.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/