]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
cxl: Delete an unnecessary check before the function call "kfree"
authorMarkus Elfring <elfring@users.sourceforge.net>
Fri, 6 Nov 2015 10:00:23 +0000 (11:00 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 12 Apr 2016 11:05:21 +0000 (21:05 +1000)
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 <elfring@users.sourceforge.net>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
drivers/misc/cxl/context.c

index 10370f28050075fac6bbc550168e47e5e091b0f7..80203c993b5e4f0637956fd0f8627c1b31828cb4 100644 (file)
@@ -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);