From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> Signed-off-by: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> --- sysfs.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/sysfs.c b/sysfs.c index 10e1597..d501792 100644 --- a/sysfs.c +++ b/sysfs.c @@ -387,7 +387,7 @@ unsigned long long get_component_size(int fd) return 0; n = read(fd, fname, sizeof(fname)); close(fd); - if (n == sizeof(fname)) + if (n < 0 || n == sizeof(fname)) return 0; fname[n] = 0; return strtoull(fname, NULL, 10) * 2; -- 1.7.6.4 -- 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