lkml.org 
[lkml]   [2015]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH] cxl: Delete an unnecessary check before the function call "kfree"
    From
    Date
    From: Markus Elfring <elfring@users.sourceforge.net>
    Date: Fri, 6 Nov 2015 11:00:23 +0100

    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>
    ---
    drivers/misc/cxl/context.c | 4 +---
    1 file changed, 1 insertion(+), 3 deletions(-)

    diff --git a/drivers/misc/cxl/context.c b/drivers/misc/cxl/context.c
    index 2faa127..52e39b6 100644
    --- a/drivers/misc/cxl/context.c
    +++ b/drivers/misc/cxl/context.c
    @@ -275,9 +275,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);
    kfree(ctx);
    }

    --
    2.6.2


    \
     
     \ /
      Last update: 2015-11-06 11:21    [W:4.162 / U:0.136 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site