aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2010-02-26 09:10:28 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-03-02 14:28:48 -0500
commit6510b8917948283005a125c8337d3312a8a0561c (patch)
treefe437f922fe4e866b45ec0d7df89f1281b71e6ac /drivers
parent2507c05ff55fbf38326b08ed27eaed233bc75042 (diff)
airo: return from set_wep_key() when key length is zero
Even if keylen == 0 is a bug and should not really happen, better avoid possibility of passing bad value to firmware. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/airo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 698d5672a070..dc5018a6d9ed 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -5255,7 +5255,8 @@ static int set_wep_key(struct airo_info *ai, u16 index, const char *key,
5255 WepKeyRid wkr; 5255 WepKeyRid wkr;
5256 int rc; 5256 int rc;
5257 5257
5258 WARN_ON(keylen == 0); 5258 if (WARN_ON(keylen == 0))
5259 return -1;
5259 5260
5260 memset(&wkr, 0, sizeof(wkr)); 5261 memset(&wkr, 0, sizeof(wkr));
5261 wkr.len = cpu_to_le16(sizeof(wkr)); 5262 wkr.len = cpu_to_le16(sizeof(wkr));