From: Markus Elfring Date: Fri, 6 Nov 2015 10:00:23 +0000 (+0100) Subject: cxl: Delete an unnecessary check before the function call "kfree" X-Git-Tag: v4.7-rc1~108^2~165 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=1050e689a63baffdadcd33498c15d859922504c0;p=linux.git cxl: Delete an unnecessary check before the function call "kfree" The kfree() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Reviewed-by: Andrew Donnellan Acked-by: Ian Munsie Signed-off-by: Michael Ellerman --- diff --git a/drivers/misc/cxl/context.c b/drivers/misc/cxl/context.c index 10370f280500..80203c993b5e 100644 --- a/drivers/misc/cxl/context.c +++ b/drivers/misc/cxl/context.c @@ -290,8 +290,7 @@ static void reclaim_ctx(struct rcu_head *rcu) if (ctx->kernelapi) kfree(ctx->mapping); - if (ctx->irq_bitmap) - kfree(ctx->irq_bitmap); + kfree(ctx->irq_bitmap); /* Drop ref to the afu device taken during cxl_context_init */ cxl_afu_put(ctx->afu);