From: Ajay Singh Date: Tue, 4 Sep 2018 06:39:20 +0000 (+0530) Subject: staging: wilc1000: remove unnecessary NULL check in clear_shadow_scan() X-Git-Tag: v4.20-rc1~72^2~409 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=009324daf6a021cb5978b1bcb8b53018c191e1ab;p=thirdparty%2Flinux.git staging: wilc1000: remove unnecessary NULL check in clear_shadow_scan() Cleanup patch to remove the unnecessary NULL check before freeing up ies information in clear_shadow_scan(). Signed-off-by: Ajay Singh Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index ede9134722e3d..00a167bd73086 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -165,10 +165,8 @@ static void clear_shadow_scan(void) return; for (i = 0; i < last_scanned_cnt; i++) { - if (last_scanned_shadow[i].ies) { - kfree(last_scanned_shadow[i].ies); - last_scanned_shadow[i].ies = NULL; - } + kfree(last_scanned_shadow[i].ies); + last_scanned_shadow[i].ies = NULL; kfree(last_scanned_shadow[i].join_params); last_scanned_shadow[i].join_params = NULL;