Message ID | 1503559816-21538-1-git-send-email-jesse.sung@canonical.com |
---|---|
State | New |
Headers | show |
Pretty simple and straightforward, should have no regression concern.
Acked-By: AceLan Kao <acelan.kao@canonical.com>
On 24.08.2017 09:37, AceLan Kao wrote: > Pretty simple and straightforward, should have no regression concern. > Acked-By: AceLan Kao <acelan.kao@canonical.com> > ...left at the intersection. One ACK each (only) ;)
On 24.08.2017 09:30, Wen-chien Jesse Sung wrote: > BugLink: https://launchpad.net/bugs/1712746 > No SRU justification in bug report. > The wiphy may be NULL sometimes. Do not dereference when it's NULL. > No source quoted. Cherry-picked? From where? Possibly needed in Zesty, too? -Stefan > Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com> > --- > net/wireless/util.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/wireless/util.c b/net/wireless/util.c > index baf7218..e358511 100644 > --- a/net/wireless/util.c > +++ b/net/wireless/util.c > @@ -121,7 +121,7 @@ struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, > int i; > > for (band = 0; band < IEEE80211_NUM_BANDS; band++) { > - sband = wiphy->bands[band]; > + sband = wiphy ? wiphy->bands[band] : NULL; > > if (!sband) > continue; >
Hi Stefan, Sorry I didn't get this mail before I sent v2 patches... 2017-08-24 16:00 GMT+08:00 Stefan Bader <stefan.bader@canonical.com>: > > On 24.08.2017 09:30, Wen-chien Jesse Sung wrote: > > BugLink: https://launchpad.net/bugs/1712746 > > > No SRU justification in bug report. > > > The wiphy may be NULL sometimes. Do not dereference when it's NULL. > > > No source quoted. Cherry-picked? From where? Possibly needed in Zesty, too? There is a NULL pointer deference oops with 4.13-rc6, but it happens at a different location. Thus I think these patches may or may not fit into Zesty. Will need to reproduce this issue with a Zesty kernel and then we'll know if these patches help. Thanks, Jesse > > > -Stefan > > Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com> > > --- > > net/wireless/util.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/net/wireless/util.c b/net/wireless/util.c > > index baf7218..e358511 100644 > > --- a/net/wireless/util.c > > +++ b/net/wireless/util.c > > @@ -121,7 +121,7 @@ struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, > > int i; > > > > for (band = 0; band < IEEE80211_NUM_BANDS; band++) { > > - sband = wiphy->bands[band]; > > + sband = wiphy ? wiphy->bands[band] : NULL; > > > > if (!sband) > > continue; > > > > > > -- > kernel-team mailing list > kernel-team@lists.ubuntu.com > https://lists.ubuntu.com/mailman/listinfo/kernel-team >
On 24/08/17 08:30, Wen-chien Jesse Sung wrote: > BugLink: https://launchpad.net/bugs/1712746 > > The wiphy may be NULL sometimes. Do not dereference when it's NULL. > > Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com> > --- > net/wireless/util.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/wireless/util.c b/net/wireless/util.c > index baf7218..e358511 100644 > --- a/net/wireless/util.c > +++ b/net/wireless/util.c > @@ -121,7 +121,7 @@ struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, > int i; > > for (band = 0; band < IEEE80211_NUM_BANDS; band++) { > - sband = wiphy->bands[band]; > + sband = wiphy ? wiphy->bands[band] : NULL; > > if (!sband) > continue; > I am curious why wiphy can be null, is there some underlying bug somewhere else that is the root cause than needs fixing rather than papering over the issue with these workarounds? Colin
2017-08-24 16:36 GMT+08:00 Colin Ian King <colin.king@canonical.com>: > On 24/08/17 08:30, Wen-chien Jesse Sung wrote: >> BugLink: https://launchpad.net/bugs/1712746 >> >> The wiphy may be NULL sometimes. Do not dereference when it's NULL. >> >> Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com> >> --- >> net/wireless/util.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/net/wireless/util.c b/net/wireless/util.c >> index baf7218..e358511 100644 >> --- a/net/wireless/util.c >> +++ b/net/wireless/util.c >> @@ -121,7 +121,7 @@ struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, >> int i; >> >> for (band = 0; band < IEEE80211_NUM_BANDS; band++) { >> - sband = wiphy->bands[band]; >> + sband = wiphy ? wiphy->bands[band] : NULL; >> >> if (!sband) >> continue; >> > > I am curious why wiphy can be null, is there some underlying bug > somewhere else that is the root cause than needs fixing rather than > papering over the issue with these workarounds? Most likely it's a bug in mwifiex... We've already pinged Marvell and Murata. These workarounds can be a temporary solution until there's a real fix. > > Colin
On 24/08/17 09:43, Jesse Sung wrote: > 2017-08-24 16:36 GMT+08:00 Colin Ian King <colin.king@canonical.com>: >> On 24/08/17 08:30, Wen-chien Jesse Sung wrote: >>> BugLink: https://launchpad.net/bugs/1712746 >>> >>> The wiphy may be NULL sometimes. Do not dereference when it's NULL. >>> >>> Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com> >>> --- >>> net/wireless/util.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/net/wireless/util.c b/net/wireless/util.c >>> index baf7218..e358511 100644 >>> --- a/net/wireless/util.c >>> +++ b/net/wireless/util.c >>> @@ -121,7 +121,7 @@ struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, >>> int i; >>> >>> for (band = 0; band < IEEE80211_NUM_BANDS; band++) { >>> - sband = wiphy->bands[band]; >>> + sband = wiphy ? wiphy->bands[band] : NULL; >>> >>> if (!sband) >>> continue; >>> >> >> I am curious why wiphy can be null, is there some underlying bug >> somewhere else that is the root cause than needs fixing rather than >> papering over the issue with these workarounds? > > Most likely it's a bug in mwifiex... We've already pinged Marvell and Murata. > These workarounds can be a temporary solution until there's a real fix. OK, sounds good to me. Thanks Jesse. > >> >> Colin
diff --git a/net/wireless/util.c b/net/wireless/util.c index baf7218..e358511 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -121,7 +121,7 @@ struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, int i; for (band = 0; band < IEEE80211_NUM_BANDS; band++) { - sband = wiphy->bands[band]; + sband = wiphy ? wiphy->bands[band] : NULL; if (!sband) continue;
BugLink: https://launchpad.net/bugs/1712746 The wiphy may be NULL sometimes. Do not dereference when it's NULL. Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com> --- net/wireless/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)