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:
Dan Williams 2009-01-20 01:33:56 -07:00
parent be2c0e387b
commit 03cd4cc810
1 changed files with 7 additions and 0 deletions

View File

@ -1415,6 +1415,13 @@ static int imsm_read_serial(int fd, char *devname,
/* trim leading whitespace */
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];
c = rsp_buf;
while (isspace(*c))