From 03cd4cc810fdaea1613fa6a792564aa96451f447 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 20 Jan 2009 01:33:56 -0700 Subject: [PATCH] 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 --- super-intel.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/super-intel.c b/super-intel.c index 4eaca9d..ce9a5c1 100644 --- a/super-intel.c +++ b/super-intel.c @@ -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))