imsm: imsm_read_serial check for zero-length response
VMWare virtual disks successfully run the inquiry but return a zero response. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
parent
be2c0e387b
commit
03cd4cc810
|
@ -1415,6 +1415,13 @@ static int imsm_read_serial(int fd, char *devname,
|
||||||
|
|
||||||
/* trim leading whitespace */
|
/* trim leading whitespace */
|
||||||
rsp_len = scsi_serial[3];
|
rsp_len = scsi_serial[3];
|
||||||
|
if (!rsp_len) {
|
||||||
|
if (devname)
|
||||||
|
fprintf(stderr,
|
||||||
|
Name ": Failed to retrieve serial for %s\n",
|
||||||
|
devname);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
rsp_buf = (char *) &scsi_serial[4];
|
rsp_buf = (char *) &scsi_serial[4];
|
||||||
c = rsp_buf;
|
c = rsp_buf;
|
||||||
while (isspace(*c))
|
while (isspace(*c))
|
||||||
|
|
Loading…
Reference in New Issue