[PATCH] prism54: prism54_get_encode() test below 0 on unsigned index

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <mcgrof@...>, <linux-wireless@...>
Cc: lkml <linux-kernel@...>
Date: Wednesday, April 23, 2008 - 3:56 pm

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>
---
diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c
index e5b3c28..5b375b2 100644
--- a/drivers/net/wireless/prism54/isl_ioctl.c
+++ b/drivers/net/wireless/prism54/isl_ioctl.c
@@ -1186,7 +1186,7 @@ prism54_get_encode(struct net_device *ndev, struct iw_request_info *info,
 	rvalue |= mgt_get_request(priv, DOT11_OID_DEFKEYID, 0, NULL, &r);
 	devindex = r.u;
 	/* Now get the key, return it */
-	if ((index < 0) || (index > 3))
+	if (index == -1 || index > 3)
 		/* no index provided, use the current one */
 		index = devindex;
 	rvalue |= mgt_get_request(priv, DOT11_OID_DEFKEYX, index, NULL, &r);
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] prism54: prism54_get_encode() test below 0 on unsign..., Roel Kluin, (Wed Apr 23, 3:56 pm)
Re: [PATCH v2] prism54: prism54_get_encode() test below 0 on..., Luis R. Rodriguez, (Sat Apr 26, 12:39 am)