Message ID | 1503562624-24417-2-git-send-email-jesse.sung@canonical.com |
---|---|
State | New |
Headers | show |
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(-)