From: Jes Sorensen Date: Wed, 9 Mar 2016 19:11:02 +0000 (-0500) Subject: super_intel: imsm_manage_reshape(): Fix potential NULL pointer dereference X-Git-Tag: mdadm-4.0~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79a16a9b359afbd5687456c4c43c13ac1946826b;p=thirdparty%2Fmdadm.git super_intel: imsm_manage_reshape(): Fix potential NULL pointer dereference 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 --- diff --git a/super-intel.c b/super-intel.c index 26b7fe75..f04ac2f6 100644 --- a/super-intel.c +++ b/super-intel.c @@ -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 */