projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
50e9291
)
[SCSI] libosd: check for kzalloc() failure
author
Dan Carpenter
<
[email protected]
>
Wed, 30 Jan 2013 07:06:02 +0000
(10:06 +0300)
committer
James Bottomley
<
[email protected]
>
Fri, 22 Feb 2013 11:26:40 +0000
(11:26 +0000)
There wasn't any error handling for this kzalloc().
Signed-off-by: Dan Carpenter <
[email protected]
>
Acked-by: Boaz Harrosh <
[email protected]
>
Signed-off-by: James Bottomley <
[email protected]
>
drivers/scsi/osd/osd_initiator.c
patch
|
blob
|
history
diff --git
a/drivers/scsi/osd/osd_initiator.c
b/drivers/scsi/osd/osd_initiator.c
index c06b8e5aa2cf3c2a488fa6f5af0455b54cf03e78..d8293f25ca339637ed1fe705b23a32acebb3a03f 100644
(file)
--- a/
drivers/scsi/osd/osd_initiator.c
+++ b/
drivers/scsi/osd/osd_initiator.c
@@
-144,6
+144,10
@@
static int _osd_get_print_system_info(struct osd_dev *od,
odi->osdname_len = get_attrs[a].len;
/* Avoid NULL for memcmp optimization 0-length is good enough */
odi->osdname = kzalloc(odi->osdname_len + 1, GFP_KERNEL);
+ if (!odi->osdname) {
+ ret = -ENOMEM;
+ goto out;
+ }
if (odi->osdname_len)
memcpy(odi->osdname, get_attrs[a].val_ptr, odi->osdname_len);
OSD_INFO("OSD_NAME [%s]\n", odi->osdname);