lkml.org 
[lkml]   [2015]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] net: sctp: Deletion of an unnecessary check before the function call "kfree"
    From: Markus Elfring <elfring@users.sourceforge.net>
    Date: Sat, 31 Jan 2015 18:10:03 +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>
    ---
    net/sctp/associola.c | 3 +--
    1 file changed, 1 insertion(+), 2 deletions(-)

    diff --git a/net/sctp/associola.c b/net/sctp/associola.c
    index f791edd..3c2aefc 100644
    --- a/net/sctp/associola.c
    +++ b/net/sctp/associola.c
    @@ -391,8 +391,7 @@ void sctp_association_free(struct sctp_association *asoc)
    sctp_asconf_queue_teardown(asoc);

    /* Free pending address space being deleted */
    - if (asoc->asconf_addr_del_pending != NULL)
    - kfree(asoc->asconf_addr_del_pending);
    + kfree(asoc->asconf_addr_del_pending);

    /* AUTH - Free the endpoint shared keys */
    sctp_auth_destroy_keys(&asoc->endpoint_shared_keys);
    --
    2.2.2


    \
     
     \ /
      Last update: 2015-01-31 18:21    [W:4.088 / U:1.148 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site