From: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
To: wu zhangjin <wuzhangjin@gmail.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
Hin-Tak Leung <htl10@users.sourceforge.net>,
Herton Ronaldo Krzesinski <herton@canonical.com>,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
Roman Mamedov <rm@romanrm.ru>
Subject: Re: [RFC PATCH] rtl8187: Fix led support for rfkill
Date: Thu, 31 Mar 2011 14:19:03 -0300 [thread overview]
Message-ID: <20110331171902.GA4010@herton-IdeaPad-Y430> (raw)
In-Reply-To: <AANLkTinwG5BR5=S14XYcwZ39c3k0xc9+2VsQFS+JHB0f@mail.gmail.com>
On Fri, Apr 01, 2011 at 12:22:51AM +0800, wu zhangjin wrote:
> On Mon, Mar 28, 2011 at 11:40 PM, Herton Ronaldo Krzesinski
> <herton.krzesinski@canonical.com> wrote:
> [...]
> >>
> >> My rtl8187 devices are both external USB sticks, thus they have no
> >> interaction with a radio-kill switch. I will test your patch to make
> >> sure it does no harm to my system.
> >>
> >> I think the commit message should be revised. A simple statement
> >> like "the LED does not turn off when the rfkill switch is off"
> >> should be sufficient.
> >
> > The patch should work, but I wonder if we should be fiddling with priv->vif
> > for this, perhaps we should not assume vif to be valid after
> > rtl8187_remove_interface (I don't see problems with current
> > rtl8187/mac80211 code on a quick look, but...)
> >
>
> Yes, but seems only two places have touched the vif pointer.
>
> $ grep "vif =" -ur drivers/net/wireless/rtl818x/rtl8187/
> drivers/net/wireless/rtl818x/rtl8187/dev.c: priv->vif = NULL;
> drivers/net/wireless/rtl818x/rtl8187/dev.c: priv->vif = vif;
>
> > I cleaner solution may be to use a priv->mode like p54.
>
> Yep, then, we may need to add a 'mode' member to rtl8187_priv and
> update it properly like p54.
>
> So, What do you prefer? I will prepare a new patch asap.
In the led code we dereference priv->vif, checking for priv->vif->type.
vif is a pointer from mac80211, and after rtl8187_remove_interface is
called by it, at least from my POV can do anything it wants with vif,
like freeing the sdata vif points to. From what I checked, it doesn't
free currently and your patch don't have issues, but may be it's better
to be safe and add a new "future proof" mode field.
And as your bug shows, the led code access priv->vif after
rtl8187_remove_interface, so we hit the case where vif could be
considered invalid.
So because of this and being cleaner I would go adding 'mode'.
>
> Best Regards,
> Wu Zhangjin
>
> >
> >>
> >> Larry
> >>
> >
> > --
> > []'s
> > Herton
> >
>
--
[]'s
Herton
next prev parent reply other threads:[~2011-03-31 17:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-26 21:19 [RFC PATCH] rtl8187: Fix led support for rfkill Wu Zhangjin
[not found] ` <1301174394-12642-1-git-send-email-wuzhangjin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-03-26 21:33 ` Hin-Tak Leung
2011-03-26 22:25 ` wu zhangjin
[not found] ` <AANLkTind3Va9J_tvZBDAPfbuyQtgxoAE+ZzG6VpU1b1q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-03-27 0:55 ` Hin-Tak Leung
[not found] ` <4D8E8B1E.3030709-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
2011-03-27 22:47 ` Larry Finger
2011-03-28 15:40 ` Herton Ronaldo Krzesinski
2011-03-31 16:22 ` wu zhangjin
2011-03-31 17:19 ` Herton Ronaldo Krzesinski [this message]
2011-04-01 3:12 ` wu zhangjin
[not found] ` <4D8FBE88.3050907-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
2011-03-31 16:04 ` wu zhangjin
2011-03-31 16:03 ` wu zhangjin
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=20110331171902.GA4010@herton-IdeaPad-Y430 \
--to=herton.krzesinski@canonical.com \
--cc=Larry.Finger@lwfinger.net \
--cc=herton@canonical.com \
--cc=htl10@users.sourceforge.net \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rm@romanrm.ru \
--cc=wuzhangjin@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