diff options
author | Xiao Ni <xni@redhat.com> | 2024-07-26 09:14:09 +0200 |
---|---|---|
committer | Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | 2024-08-05 11:12:37 +0200 |
commit | f34040081c36ff92180674b89c39ddc7bdd47288 (patch) | |
tree | 622473ce8d238352ce9a1d8887f01bae280b56fa | |
parent | mdadm/mdmon: fix coverity issue RESOURCE_LEAK (diff) | |
download | mdadm-f34040081c36ff92180674b89c39ddc7bdd47288.tar.xz mdadm-f34040081c36ff92180674b89c39ddc7bdd47288.zip |
mdadm/mdopen: fix coverity issue CHECKED_RETURN
It needs to check return values when functions return value.
Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
-rw-r--r-- | mdopen.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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) |