[rt2x00-users] [PATCH 1/4] rt2x00: if we do not support the RF chip, return ENOTSUPP

Thadeu Lima de Souza Cascardo cascardo at holoscopio.com
Mon Aug 31 15:57:34 UTC 2009


In rt2800pci, when probing, if we find a chip we do not support, we may
end up allocating 0 channels, which will oops. We may assume other chips
have 14 channels or return ENOTSUPP, which is what we do by now. We may
change this later.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo at holoscopio.com>
---
 drivers/net/wireless/rt2x00/rt2800pci.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 5780c36..d83075b 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -2845,6 +2845,8 @@ static int rt2800pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
 		spec->supported_bands |= SUPPORT_BAND_5GHZ;
 		spec->num_channels = ARRAY_SIZE(rf_vals);
 		spec->channels = rf_vals;
+	} else {
+		return -ENOTSUPP;
 	}
 
 	/*
-- 
1.6.3.3




More information about the users mailing list