]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
super_intel: imsm_manage_reshape(): Fix potential NULL pointer dereference
authorJes Sorensen <Jes.Sorensen@redhat.com>
Wed, 9 Mar 2016 19:11:02 +0000 (14:11 -0500)
committerJes Sorensen <Jes.Sorensen@redhat.com>
Tue, 22 Mar 2016 18:05:27 +0000 (14:05 -0400)
If sra == NULL we cannot goto abort, as it would result in calls to
sysfs_set_num() which would dereference sra.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
super-intel.c

index 26b7fe75171b21ed17e81e821fb98bbd5b3804d8..f04ac2f6ed1c38368896cd0eb11f5244f6a3fdd7 100644 (file)
@@ -10521,7 +10521,10 @@ static int imsm_manage_reshape(
        int degraded = 0;
        int source_layout = 0;
 
-       if (!fds || !offsets || !sra)
+       if (!sra)
+               return ret_val;
+
+       if (!fds || !offsets)
                goto abort;
 
        /* Find volume during the reshape */