summaryrefslogtreecommitdiffstats
path: root/super-intel.c
diff options
context:
space:
mode:
Diffstat (limited to 'super-intel.c')
-rw-r--r--super-intel.c7
1 files changed, 7 insertions, 0 deletions
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))