summaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2008-05-15 15:50:45 +1000
committerNeil Brown <neilb@suse.de>2008-05-15 15:50:45 +1000
commit3b0896f89988923c314cfb07454dde23b1b401fc (patch)
tree3b04e261219c01919d313d562838ca94de76e7d5 /util.c
parentddd1a492519d61587cdd92660b875b82f4832176 (diff)
downloadmdadm-3b0896f89988923c314cfb07454dde23b1b401fc.tar.gz
mdadm-3b0896f89988923c314cfb07454dde23b1b401fc.tar.xz
mdadm-3b0896f89988923c314cfb07454dde23b1b401fc.zip
Fix possible NULL dereference in super_by_fd
Diffstat (limited to 'util.c')
-rw-r--r--util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/util.c b/util.c
index 108f3c1..1ad6fd0 100644
--- a/util.c
+++ b/util.c
@@ -757,7 +757,8 @@ struct supertype *super_by_fd(int fd)
if (sra)
sysfs_free(sra);
- st->sb = NULL;
+ if (st)
+ st->sb = NULL;
return st;
}