summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00
diff options
context:
space:
mode:
authorStanislaw Gruszka <stf_xl@wp.pl>2013-03-16 19:19:29 +0100
committerJohn W. Linville <linville@tuxdriver.com>2013-03-18 16:38:29 -0400
commit53216d6a9a2dd3b0a65203e540b7739c36351d55 (patch)
treedace15ef1d32fe7ec6c735f15106692838f3e9c5 /drivers/net/wireless/rt2x00
parent8857d6dc77e4e3afeee2f33c49597010130ed858 (diff)
downloadop-kernel-dev-53216d6a9a2dd3b0a65203e540b7739c36351d55.zip
op-kernel-dev-53216d6a9a2dd3b0a65203e540b7739c36351d55.tar.gz
rt2800: do not crash if spec->channels is NULL
In case the spec->channels was not specified, print warning instead of hard crash the kernel. Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl> Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r--drivers/net/wireless/rt2x00/rt2800lib.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index a658b4b..182e598 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -5213,6 +5213,9 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
spec->channels = rf_vals_3x;
}
+ if (WARN_ON_ONCE(!spec->channels))
+ return -ENODEV;
+
/*
* Initialize HT information.
*/
OpenPOWER on IntegriCloud