diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00.h')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 5bc100db28d4..99e89596cef6 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -851,13 +851,15 @@ struct rt2x00_dev { | |||
851 | static inline void rt2x00_rf_read(struct rt2x00_dev *rt2x00dev, | 851 | static inline void rt2x00_rf_read(struct rt2x00_dev *rt2x00dev, |
852 | const unsigned int word, u32 *data) | 852 | const unsigned int word, u32 *data) |
853 | { | 853 | { |
854 | *data = rt2x00dev->rf[word]; | 854 | BUG_ON(word < 1 || word > rt2x00dev->ops->rf_size / sizeof(u32)); |
855 | *data = rt2x00dev->rf[word - 1]; | ||
855 | } | 856 | } |
856 | 857 | ||
857 | static inline void rt2x00_rf_write(struct rt2x00_dev *rt2x00dev, | 858 | static inline void rt2x00_rf_write(struct rt2x00_dev *rt2x00dev, |
858 | const unsigned int word, u32 data) | 859 | const unsigned int word, u32 data) |
859 | { | 860 | { |
860 | rt2x00dev->rf[word] = data; | 861 | BUG_ON(word < 1 || word > rt2x00dev->ops->rf_size / sizeof(u32)); |
862 | rt2x00dev->rf[word - 1] = data; | ||
861 | } | 863 | } |
862 | 864 | ||
863 | /* | 865 | /* |