From: Dan Carpenter <error27@gmail.com>
To: "Sjur Brændeland" <sjurbren@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
"open list:CAIF NETWORK LAYER" <netdev@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: Re: [patch -next] caif: add error handling for allocation
Date: Fri, 2 Sep 2011 18:51:27 +0300 [thread overview]
Message-ID: <20110902155127.GI2430@shale.localdomain> (raw)
In-Reply-To: <CAJK669Yb6V=xr9ZvQGOKGEvmzO1JGhrHD+sR69b04EQxUjOOrQ@mail.gmail.com>
On Fri, Sep 02, 2011 at 11:40:23AM +0200, Sjur Brændeland wrote:
> Thank you for your patch.
> When reviewing this I found another potential memory leak as well.
> If cffrml_create fails, we might be leaking the phy_driver.
> So perhaps you could do kfree(phy_driver) in out_err: as well, while
> you are at it?
>
Good point. A kfree(phy_driver) would fix the leak. But why does
cfserl_create() return &this->layer; instead of just "return this;"
Their equivalent now, but if you change the cfserl struct it will
break the kfree().
I'll be travelling for a while, so I may be out of reach until
Wednessday.
regards,
dan carpenter
next prev parent reply other threads:[~2011-09-02 15:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-02 8:07 [patch -next] caif: add error handling for allocation Dan Carpenter
2011-09-02 9:40 ` Sjur Brændeland
2011-09-02 12:19 ` [PATCH] caif: fix a potential NULL dereference Eric Dumazet
2011-09-02 13:13 ` Sjur Brændeland
2011-09-16 22:56 ` David Miller
2011-09-02 15:51 ` Dan Carpenter [this message]
2011-09-21 7:21 ` [patch v2] caif: add error handling for allocation Dan Carpenter
2011-09-23 10:38 ` Sjur BRENDELAND
2011-10-03 17:46 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110902155127.GI2430@shale.localdomain \
--to=error27@gmail.com \
--cc=davem@davemloft.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sjurbren@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).