lkml.org 
[lkml]   [2010]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[22/34] SCSI: enclosure: fix error path - actually return ERR_PTR() on error
2.6.32-stable review patch.  If anyone has any objections, please let us know.

------------------
From: James Bottomley <James.Bottomley@suse.de>

commit a91c1be21704113b023919826c6d531da46656ef upstream.

we also need to clean up and free the cdev.

Reported-by: Jani Nikula <ext-jani.1.nikula@nokia.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
drivers/misc/enclosure.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/drivers/misc/enclosure.c
+++ b/drivers/misc/enclosure.c
@@ -284,8 +284,11 @@ enclosure_component_register(struct encl
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;
}



\
 
 \ /
  Last update: 2010-08-06 21:13    [from the cache]
©2003-2011 Jasper Spaans