提交 6510b891 编写于 作者: S Stanislaw Gruszka 提交者: John W. Linville

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: NStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 2507c05f
......@@ -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));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册