diff options
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, | |||
144 | odi->osdname_len = get_attrs[a].len; | 144 | odi->osdname_len = get_attrs[a].len; |
145 | /* Avoid NULL for memcmp optimization 0-length is good enough */ | 145 | /* Avoid NULL for memcmp optimization 0-length is good enough */ |
146 | odi->osdname = kzalloc(odi->osdname_len + 1, GFP_KERNEL); | 146 | odi->osdname = kzalloc(odi->osdname_len + 1, GFP_KERNEL); |
147 | if (!odi->osdname) { | ||
148 | ret = -ENOMEM; | ||
149 | goto out; | ||
150 | } | ||
147 | if (odi->osdname_len) | 151 | if (odi->osdname_len) |
148 | memcpy(odi->osdname, get_attrs[a].val_ptr, odi->osdname_len); | 152 | memcpy(odi->osdname, get_attrs[a].val_ptr, odi->osdname_len); |
149 | OSD_INFO("OSD_NAME [%s]\n", odi->osdname); | 153 | OSD_INFO("OSD_NAME [%s]\n", odi->osdname); |