Fix possible NULL dereference in super_by_fd
authorNeil Brown <neilb@suse.de>
Thu, 15 May 2008 05:50:45 +0000 (15:50 +1000)
committerNeil Brown <neilb@suse.de>
Thu, 15 May 2008 05:50:45 +0000 (15:50 +1000)
util.c

diff --git a/util.c b/util.c
index 108f3c1..1ad6fd0 100644 (file)
--- 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;
 }