diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2010-02-26 15:10:28 +0100 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-03-02 14:28:48 -0500 |
commit | 6510b8917948283005a125c8337d3312a8a0561c (patch) | |
tree | fe437f922fe4e866b45ec0d7df89f1281b71e6ac /drivers/net/wireless/airo.c | |
parent | 2507c05ff55fbf38326b08ed27eaed233bc75042 (diff) | |
download | linux-6510b8917948283005a125c8337d3312a8a0561c.tar.bz2 |
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/net/wireless/airo.c')
-rw-r--r-- | drivers/net/wireless/airo.c | 3 |
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, WepKeyRid wkr; int rc; - WARN_ON(keylen == 0); + if (WARN_ON(keylen == 0)) + return -1; memset(&wkr, 0, sizeof(wkr)); wkr.len = cpu_to_le16(sizeof(wkr)); |