diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-01-30 08:06:02 +0100 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-02-22 12:26:40 +0100 |
commit | 6d1f6621fa12800fc84f62db9e0b7a6b623eb439 (patch) | |
tree | 66bb22fca895c2867085ad7f2a84982b8efd4a33 /drivers/scsi/osd | |
parent | [SCSI] qla4xxx: don't free NULL dma pool (diff) | |
download | linux-6d1f6621fa12800fc84f62db9e0b7a6b623eb439.tar.xz linux-6d1f6621fa12800fc84f62db9e0b7a6b623eb439.zip |
[SCSI] libosd: check for kzalloc() failure
There wasn't any error handling for this kzalloc().
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/osd')
-rw-r--r-- | drivers/scsi/osd/osd_initiator.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c index c06b8e5aa2cf..d8293f25ca33 100644 --- 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); |