mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
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>
This commit is contained in:
parent
2507c05ff5
commit
6510b89179
1 changed files with 2 additions and 1 deletions
|
@ -5255,7 +5255,8 @@ static int set_wep_key(struct airo_info *ai, u16 index, const char *key,
|
||||||
WepKeyRid wkr;
|
WepKeyRid wkr;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
WARN_ON(keylen == 0);
|
if (WARN_ON(keylen == 0))
|
||||||
|
return -1;
|
||||||
|
|
||||||
memset(&wkr, 0, sizeof(wkr));
|
memset(&wkr, 0, sizeof(wkr));
|
||||||
wkr.len = cpu_to_le16(sizeof(wkr));
|
wkr.len = cpu_to_le16(sizeof(wkr));
|
||||||
|
|
Loading…
Reference in a new issue