summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--super-intel.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/super-intel.c b/super-intel.c
index b583b35c..f776be9e 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -2868,8 +2868,10 @@ static void fd2devname(int fd, char *name)
dname[rv] = '\0';
nm = strrchr(dname, '/');
- nm++;
- snprintf(name, MAX_RAID_SERIAL_LEN, "/dev/%s", nm);
+ if (nm) {
+ nm++;
+ snprintf(name, MAX_RAID_SERIAL_LEN, "/dev/%s", nm);
+ }
}
extern int scsi_get_serial(int fd, void *buf, size_t buf_len);