From 79a16a9b359afbd5687456c4c43c13ac1946826b Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Wed, 9 Mar 2016 14:11:02 -0500 Subject: [PATCH] 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 --- super-intel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 */ -- 2.39.2