summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdopen.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mdopen.c b/mdopen.c
index eaa59b59..c9fda131 100644
--- a/mdopen.c
+++ b/mdopen.c
@@ -406,7 +406,11 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
perror("chown");
if (chmod(devname, ci->mode))
perror("chmod");
- stat(devname, &stb);
+ if (stat(devname, &stb) < 0) {
+ pr_err("failed to stat %s\n",
+ devname);
+ return -1;
+ }
add_dev(devname, &stb, 0, NULL);
}
if (use_mdp == 1)