projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aac3118
)
[SCSI] enclosure: fix error path - actually return ERR_PTR() on error
author
James Bottomley
<James.Bottomley@suse.de>
Fri, 12 Mar 2010 22:14:42 +0000
(16:14 -0600)
committer
James Bottomley
<James.Bottomley@suse.de>
Tue, 27 Jul 2010 17:03:48 +0000
(12:03 -0500)
we also need to clean up and free the cdev.
Reported-by: Jani Nikula <ext-jani.1.nikula@nokia.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/misc/enclosure.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/misc/enclosure.c
b/drivers/misc/enclosure.c
index 48c84a58163e460b36ac68c7951b55e01f06bc09..00e5fcac8fdf8872e9ea8af6cf830e990e32837d 100644
(file)
--- a/
drivers/misc/enclosure.c
+++ b/
drivers/misc/enclosure.c
@@
-285,8
+285,11
@@
enclosure_component_register(struct enclosure_device *edev,
cdev->groups = enclosure_groups;
err = device_register(cdev);
- if (err)
- ERR_PTR(err);
+ if (err) {
+ ecomp->number = -1;
+ put_device(cdev);
+ return ERR_PTR(err);
+ }
return ecomp;
}