WaitClean(): stat2devnm() returns NULL for non block devices. Check the pointer is valid derefencing it. This would happen when using --waitclean, such as the 'f' and 'd' file type, causing a core dump. Signed-off-by: Zhilong Liu <zlliu@xxxxxxxx> --- Monitor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Monitor.c b/Monitor.c index 036a561..101b765 100644 --- a/Monitor.c +++ b/Monitor.c @@ -1076,6 +1076,8 @@ int WaitClean(char *dev, int sock, int verbose) pr_err("Couldn't open %s: %s\n", dev, strerror(errno)); return 1; } + if (check_blkdev_via_fstat(fd, dev)) + return 2; strcpy(devnm, fd2devnm(fd)); mdi = sysfs_read(fd, devnm, GET_VERSION|GET_LEVEL|GET_SAFEMODE); -- 2.10.2 -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html