Search Linux Wireless

Re: [PATCH 20/24] regulatory: fix memory leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2012-12-13 at 13:35 -0800, Luis R. Rodriguez wrote:
> On Thu, Dec 6, 2012 at 8:47 AM, Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote:
> > From: Johannes Berg <johannes.berg@xxxxxxxxx>
> >
> > If duplicating here fails, we leak the original.
> >
> > Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
> > ---
> >  net/wireless/reg.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/net/wireless/reg.c b/net/wireless/reg.c
> > index 011fab9..5a34830 100644
> > --- a/net/wireless/reg.c
> > +++ b/net/wireless/reg.c
> > @@ -2120,8 +2120,10 @@ static int __set_regdom(const struct ieee80211_regdomain *rd)
> >                         return -EALREADY;
> >
> >                 regd = reg_copy_regd(rd);
> > -               if (IS_ERR(regd))
> > +               if (IS_ERR(regd)) {
> > +                       kfree(rd);
> >                         return PTR_ERR(regd);
> > +               }
> 
> The caller, set_regdom() free's t for us if we fail though so I don't
> see how this was leaked.

Oops, so this patch is wrong, I'll drop it.

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux