lkml.org 
[lkml]   [2011]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] rfc4106, Intel, AES-NI: Don't leak memory in rfc4106_set_hash_subkey().
    On Mon, 7 Feb 2011, tadeusz.struk@intel.com wrote:

    > From:
    > Date: Sun, 16 Jan 2011 16:41:11 +0000
    > Subject: RE: [PATCH] rfc4106, Intel, AES-NI: Don't leak memory in rfc4106_set_hash_subkey().
    >
    > Hi Jesper,
    > Thanks, but I think there is still a problem here. You don't want to kfree req_data
    > when the kmalloc failed. I think it should look as follows.
    > Are you ok with this?
    >
    Fine by me.

    I was aware of the kfree(NULL) thing, but desided to leave it as is for
    two reasons - 1) kfree(NULL) is harmless and this is an error path, so the
    extra function call doesn't matter much. 2) I wanted to preserve
    deallocations in the reverse order of the allocations. But sure, moving
    that kfree is a tiny optimization of the error path, so I'm fine with it.


    --
    Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/
    Plain text mails only, please.
    Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html



    \
     
     \ /
      Last update: 2011-02-07 19:29    [W:0.022 / U:31.568 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site