[PATCH v2 1/2] staging: rtl8188eu: integer type replaced by size_t in length variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



wpa_ie_len and copy_len variables never take negative values and are used to indicate the length of the string, so more suitable for them size_t type.

Signed-off-by: Ivan Safonov <insafonov@xxxxxxxxx>
---
Changes in v2:
  - big patchset splitted into some small independent patches.
  - before replacing (?:) to macro min variables given to the appropriate type.

 drivers/staging/rtl8188eu/core/rtw_mlme_ext.c  | 3 ++-
 drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
index e15c198..61d0501 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
@@ -3003,7 +3003,8 @@ static unsigned int OnAssocReq(struct adapter *padapter,
 	struct sta_info	*pstat;
 	unsigned char		reassoc, *p, *pos, *wpa_ie;
 	unsigned char WMM_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01};
-	int		i, ie_len, wpa_ie_len, left;
+	int		i, ie_len, left;
+	size_t wpa_ie_len;
 	unsigned char		supportRate[16];
 	int					supportRateNum;
 	unsigned short		status = _STATS_SUCCESSFUL_;
diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
index 9695749..71872a6 100644
--- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
@@ -2665,8 +2665,8 @@ static int rtw_get_sta_wpaie(struct net_device *dev, struct ieee_param *param)
 	if (psta) {
 		if (psta->wpa_ie[0] == WLAN_EID_RSN ||
 		    psta->wpa_ie[0] == WLAN_EID_VENDOR_SPECIFIC) {
-			int wpa_ie_len;
-			int copy_len;
+			size_t wpa_ie_len;
+			size_t copy_len;
 
 			wpa_ie_len = psta->wpa_ie[1];
 			copy_len = ((wpa_ie_len+2) > sizeof(psta->wpa_ie)) ? (sizeof(psta->wpa_ie)) : (wpa_ie_len+2);
-- 
2.4.10

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux