Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

prism54: prism54_get_encode() test below 0 on unsigned index

previously in this function:

u32 index = (dwrq->flags & IW_ENCODE_INDEX) - 1;

index is unsigned, so if -1, the original test (below) didn't work.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Roel Kluin and committed by
John W. Linville
8ba82e96 d619ee08

+1 -1
+1 -1
drivers/net/wireless/prism54/isl_ioctl.c
··· 1186 1186 rvalue |= mgt_get_request(priv, DOT11_OID_DEFKEYID, 0, NULL, &r); 1187 1187 devindex = r.u; 1188 1188 /* Now get the key, return it */ 1189 - if ((index < 0) || (index > 3)) 1189 + if (index == -1 || index > 3) 1190 1190 /* no index provided, use the current one */ 1191 1191 index = devindex; 1192 1192 rvalue |= mgt_get_request(priv, DOT11_OID_DEFKEYX, index, NULL, &r);