From: Johannes Berg <johannes@sipsolutions.net>
To: Arend Van Spriel <arend.vanspriel@broadcom.com>,
Kalle Valo <kvalo@codeaurora.org>
Cc: linux-wireless@vger.kernel.org, Daniel J Blueman <daniel@quora.org>
Subject: Re: [PATCH for-4.11 2/2] cfg80211: check rdev resume callback only for registered wiphy
Date: Wed, 29 Mar 2017 08:34:32 +0200 [thread overview]
Message-ID: <1490769272.18052.5.camel@sipsolutions.net> (raw)
In-Reply-To: <d2985a7e-5d11-284d-25f8-c4a255c24da6@broadcom.com> (sfid-20170328_164650_762503_FA0E6B53)
On Tue, 2017-03-28 at 16:46 +0200, Arend Van Spriel wrote:
>
> On 28-3-2017 16:25, Johannes Berg wrote:
> >
> > > > > - if (rdev->ops->resume) {
> > > > > - rtnl_lock();
> > > > > - if (rdev->wiphy.registered)
> > > > > - ret = rdev_resume(rdev);
> > > > > - rtnl_unlock();
> > > > > - }
> > > > > + rtnl_lock();
> > > > > + if (rdev->wiphy.registered && rdev->ops->resume)
> > > > > + ret = rdev_resume(rdev);
> > > > > + rtnl_unlock();
> > > >
> > > > Hmm? Commit message seems ... old perhaps?
> > >
> > > Hmmm, why? Before the patch rdev->ops was accessed before
> > > checking
> > > rdev->wiphy.registered. When rdev->wiphy.registers is false we no
> > > longer access rdev->ops after the patch. So a driver doing a
> > > wiphy_unregister() can safely kfree() the callback struct after
> > > it.
> >
> > Oh, right. Looks like I misinterpreted things.
>
> So apparently my choice of words was poor. Do you want me to
> rephrase?
Nah, don't worry. When I apply it I'll re-read and see if I just
confused myself or if it makes sense to reword a bit.
johannes
next prev parent reply other threads:[~2017-03-29 6:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-28 8:11 [PATCH for-4.11 0/2] brcmfmac: fixing use-after-free reports Arend van Spriel
2017-03-28 8:11 ` [PATCH for-4.11 1/2] brcmfmac: use local iftype avoiding use-after-free of virtual interface Arend van Spriel
2017-03-30 16:44 ` [for-4.11, " Kalle Valo
2017-03-28 8:11 ` [PATCH for-4.11 2/2] cfg80211: check rdev resume callback only for registered wiphy Arend van Spriel
2017-03-28 12:34 ` Johannes Berg
2017-03-28 14:13 ` Arend Van Spriel
2017-03-28 14:25 ` Johannes Berg
2017-03-28 14:46 ` Arend Van Spriel
2017-03-29 6:34 ` Johannes Berg [this message]
2017-03-29 7:13 ` Johannes Berg
2017-03-28 11:59 ` [PATCH for-4.11 0/2] brcmfmac: fixing use-after-free reports Kalle Valo
2017-03-28 14:08 ` Arend Van Spriel
2017-03-28 15:00 ` Kalle Valo
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=1490769272.18052.5.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=arend.vanspriel@broadcom.com \
--cc=daniel@quora.org \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
/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).