lkml.org 
[lkml]   [2015]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] PowerPC-rheap: Delete an unnecessary check before the function call "kfree"
    From: Markus Elfring <elfring@users.sourceforge.net>
    Date: Tue, 3 Feb 2015 14:34:10 +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>
    ---
    arch/powerpc/lib/rheap.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/arch/powerpc/lib/rheap.c b/arch/powerpc/lib/rheap.c
    index a1060a8..69abf84 100644
    --- a/arch/powerpc/lib/rheap.c
    +++ b/arch/powerpc/lib/rheap.c
    @@ -284,7 +284,7 @@ EXPORT_SYMBOL_GPL(rh_create);
    */
    void rh_destroy(rh_info_t * info)
    {
    - if ((info->flags & RHIF_STATIC_BLOCK) == 0 && info->block != NULL)
    + if ((info->flags & RHIF_STATIC_BLOCK) == 0)
    kfree(info->block);

    if ((info->flags & RHIF_STATIC_INFO) == 0)
    --
    2.2.2


    \
     
     \ /
      Last update: 2015-02-03 15:01    [W:4.020 / U:0.396 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site