From: Joe Gunn Date: Fri, 25 Feb 2011 10:08:49 +0000 (-0800) Subject: orinoco: Drop scan results with unknown channels X-Git-Tag: v2.6.39-rc1~468^2~158^2^2~29 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=46c2cb8cae87c903caba67eb8afc0f8985832956;p=~shefty%2Frdma-dev.git orinoco: Drop scan results with unknown channels If the frequency can not be mapped to a channel structure log it and drop it. Signed-off-by: Joseph J. Gunn Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/orinoco/scan.c b/drivers/net/wireless/orinoco/scan.c index 86cb54c842e..e99ca1c1e0d 100644 --- a/drivers/net/wireless/orinoco/scan.c +++ b/drivers/net/wireless/orinoco/scan.c @@ -111,6 +111,11 @@ static void orinoco_add_hostscan_result(struct orinoco_private *priv, freq = ieee80211_dsss_chan_to_freq(le16_to_cpu(bss->a.channel)); channel = ieee80211_get_channel(wiphy, freq); + if (!channel) { + printk(KERN_DEBUG "Invalid channel designation %04X(%04X)", + bss->a.channel, freq); + return; /* Then ignore it for now */ + } timestamp = 0; capability = le16_to_cpu(bss->a.capabilities); beacon_interval = le16_to_cpu(bss->a.beacon_interv);