From 6d915f2a61168023888baf8d8e36778e3f93ed9f Mon Sep 17 00:00:00 2001 From: Pragya Gupta Date: Thu, 22 Feb 2018 18:44:40 +0530 Subject: [PATCH] [7885] Driver crash on startup For single band solutions, do not access the 5g channels Change-Id: Iaf7ad26129eb43795fb03bc73cae9f58ef4409ef SCSC-Bug-Id: SSB-37249 Signed-off-by: Himani Gupta --- drivers/net/wireless/scsc/mgt.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/scsc/mgt.c b/drivers/net/wireless/scsc/mgt.c index 571bc7eca4c6..03dc4f50156d 100755 --- a/drivers/net/wireless/scsc/mgt.c +++ b/drivers/net/wireless/scsc/mgt.c @@ -4651,10 +4651,12 @@ void slsi_update_supported_channels_regd_flags(struct slsi_dev *sdev) chan->flags |= IEEE80211_CHAN_DISABLED; } } - for (i = 0; i < ARRAY_SIZE(sdev->supported_5g_channels); i++) { - if (sdev->supported_5g_channels[i] == 0) { - chan = &wiphy->bands[1]->channels[i]; - chan->flags |= IEEE80211_CHAN_DISABLED; + if (sdev->band_5g_supported) { + for (i = 0; i < ARRAY_SIZE(sdev->supported_5g_channels); i++) { + if (sdev->supported_5g_channels[i] == 0) { + chan = &wiphy->bands[1]->channels[i]; + chan->flags |= IEEE80211_CHAN_DISABLED; + } } } } -- 2.20.1