Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1509961

Re: [PATCH] mwifiex: don't do unbalanced free()'ing in cleanup_if()

From Dmitry Torokhov <dmitry.torokhov@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] mwifiex: don't do unbalanced free()'ing in cleanup_if()
Date 2016-10-27 02:00 +0200
Message-ID <swGh1-2j3-27@gated-at.bofh.it> (permalink)
References <swFXz-2ch-9@gated-at.bofh.it> <swFXz-2ch-7@gated-at.bofh.it> <swG7f-2fy-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Oct 26, 2016 at 04:43:54PM -0700, Brian Norris wrote:
> On Wed, Oct 26, 2016 at 04:35:54PM -0700, Dmitry Torokhov wrote:
> > On Wed, Oct 26, 2016 at 04:29:20PM -0700, Brian Norris wrote:
> 
> > > diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
> > > index 8718950004f3..f04cf5a551b3 100644
> > > --- a/drivers/net/wireless/marvell/mwifiex/sdio.c
> > > +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
> 
> > > @@ -2291,6 +2287,14 @@ static void mwifiex_recreate_adapter(struct sdio_mmc_card *card)
> > >  
> > >  	mwifiex_sdio_remove(func);
> > >  
> > > +	/*
> > > +	 * Normally, we would let the driver core take care of releasing these.
> > > +	 * But we're not letting the driver core handle this one. See above
> > > +	 * TODO.
> > > +	 */
> > > +	sdio_set_drvdata(func, NULL);
> > > +	devm_kfree(&func->dev, card);
> > 
> > Ugh, this really messes the unwind order... I guess it is OK since it is
> > the only resource allocated with devm, but I'd be happier if we could
> > reuse existing "card" structure.
> 
> I'm really not interested in cleaning up the hacky reset function here
> (see the other TODOs here). I'm sure it's broken in other ways too. In
> its current "design" (if you can call it that) where we remove and
> re-probe the device, I'm not sure there's a way to get it to reuse the
> 'card'.

Ah, I see now... Nevermind then.

Thanks.

-- 
Dmitry

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH] mwifiex: don't do unbalanced free()'ing in cleanup_if() Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-10-27 01:40 +0200
  Re: [PATCH] mwifiex: don't do unbalanced free()'ing in cleanup_if() Brian Norris <briannorris@chromium.org> - 2016-10-27 01:50 +0200
    Re: [PATCH] mwifiex: don't do unbalanced free()'ing in cleanup_if() Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-10-27 02:00 +0200

csiph-web