lkml.org 
[lkml]   [2014]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 1/3] net-PPP: Deletion of unnecessary checks before the function call "kfree"
    Hello.

    On 11/30/2014 7:44 PM, SF Markus Elfring wrote:

    > From: Markus Elfring <elfring@users.sourceforge.net>
    > Date: Sun, 30 Nov 2014 17:02:07 +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/net/ppp/ppp_mppe.c | 14 ++++++--------
    > 1 file changed, 6 insertions(+), 8 deletions(-)

    > diff --git a/drivers/net/ppp/ppp_mppe.c b/drivers/net/ppp/ppp_mppe.c
    > index 911b216..7e44212 100644
    > --- a/drivers/net/ppp/ppp_mppe.c
    > +++ b/drivers/net/ppp/ppp_mppe.c
    > @@ -238,8 +238,7 @@ static void *mppe_alloc(unsigned char *options, int optlen)
    > return (void *)state;
    >
    > out_free:
    > - if (state->sha1_digest)
    > - kfree(state->sha1_digest);
    > + kfree(state->sha1_digest);

    Please keep this line aligned to the others.

    > if (state->sha1)
    > crypto_free_hash(state->sha1);
    > if (state->arc4)

    [...]

    WBR, Sergei



    \
     
     \ /
      Last update: 2014-12-01 14:01    [W:4.021 / U:0.752 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site