Skip to content

Commit

Permalink
cxl: Delete an unnecessary check before the function call "kfree"
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Markus Elfring authored and Michael Ellerman committed Apr 12, 2016
1 parent 4f7bef7 commit 1050e68
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/misc/cxl/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1050e68

Please sign in to comment.