lkml.org 
[lkml]   [2011]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[28/68] sunrpc/cache: fix module refcnt leak in a failure path
    2.6.32-longterm review patch.  If anyone has any objections, please let us know.

    ------------------

    From: Li Zefan <lizf@cn.fujitsu.com>

    commit a5990ea1254cd186b38744507aeec3136a0c1c95 upstream.

    Don't forget to release the module refcnt if seq_open() returns failure.

    Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
    Cc: J. Bruce Fields <bfields@fieldses.org>
    Cc: Neil Brown <neilb@suse.de>
    Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
    Cc: maximilian attems <max@stro.at>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    net/sunrpc/cache.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    --- a/net/sunrpc/cache.c
    +++ b/net/sunrpc/cache.c
    @@ -1234,8 +1234,10 @@ static int content_open(struct inode *in
    if (!cd || !try_module_get(cd->owner))
    return -EACCES;
    han = __seq_open_private(file, &cache_content_op, sizeof(*han));
    - if (han == NULL)
    + if (han == NULL) {
    + module_put(cd->owner);
    return -ENOMEM;
    + }

    han->cd = cd;
    return 0;



    \
     
     \ /
      Last update: 2011-02-28 17:49    [W:0.023 / U:64.000 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site