From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> Signed-off-by: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> --- Manage.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Manage.c b/Manage.c index 9d2e0d0..808c2cb 100644 --- a/Manage.c +++ b/Manage.c @@ -1511,9 +1511,10 @@ int Manage_subdevs(char *devname, int fd, } else { struct stat stb; tfd = dev_open(dv->devname, O_RDONLY); - if (tfd >= 0) + if (tfd >= 0) { fstat(tfd, &stb); - else { + close(tfd); + } else { int open_err = errno; if (stat(dv->devname, &stb) != 0) { pr_err("Cannot find %s: %s\n", -- 2.5.0 -- 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