From: Shraddha Barke Date: Mon, 12 Oct 2015 15:19:18 +0000 (+0530) Subject: Staging: lustre: osc: Remove null check before kfree X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f999d0987ec1e88c455fb95e48a12a98a9fbd9a6;p=openwrt%2Fstaging%2Fblogic.git Staging: lustre: osc: Remove null check before kfree kfree on NULL pointer is a no-op. The semantic patch used to find such an instance where NULL check is present before kfree- // @@ expression E; @@ - if (E != NULL) { kfree(E); } + kfree(E); @@ expression E; @@ - if (E != NULL) { kfree(E); E = NULL; } + kfree(E); + E = NULL; // smpl> Signed-off-by: Shraddha Barke Reviewed-by: Daniel Baluta Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c index 225e5ed6714f..86c0303eb24a 100644 --- a/drivers/staging/lustre/lustre/osc/osc_request.c +++ b/drivers/staging/lustre/lustre/osc/osc_request.c @@ -1998,9 +1998,7 @@ out: if (mem_tight != 0) cfs_memory_pressure_restore(mpflag); - if (crattr != NULL) { - kfree(crattr); - } + kfree(crattr); if (rc != 0) { LASSERT(req == NULL);