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

staging: rtl8712: r8712_parse_wpa2_ie(): Change return values

Change return values of function r8712_parse_wpa2_ie from
_SUCCESS/_FAIL to 0/-EINVAL.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Nishka Dasgupta and committed by
Greg Kroah-Hartman
f5e5eaef 1ef20d57

+7 -7
+6 -6
drivers/staging/rtl8712/ieee80211.c
··· 327 327 328 328 if (rsn_ie_len <= 0) { 329 329 /* No RSN IE - fail silently */ 330 - return _FAIL; 330 + return -EINVAL; 331 331 } 332 332 if ((*rsn_ie != _WPA2_IE_ID_) || 333 333 (*(rsn_ie + 1) != (u8)(rsn_ie_len - 2))) 334 - return _FAIL; 334 + return -EINVAL; 335 335 pos = rsn_ie; 336 336 pos += 4; 337 337 left = rsn_ie_len - 4; ··· 341 341 pos += RSN_SELECTOR_LEN; 342 342 left -= RSN_SELECTOR_LEN; 343 343 } else if (left > 0) { 344 - return _FAIL; 344 + return -EINVAL; 345 345 } 346 346 /*pairwise_cipher*/ 347 347 if (left >= 2) { ··· 349 349 pos += 2; 350 350 left -= 2; 351 351 if (count == 0 || left < count * RSN_SELECTOR_LEN) 352 - return _FAIL; 352 + return -EINVAL; 353 353 for (i = 0; i < count; i++) { 354 354 *pairwise_cipher |= r8712_get_wpa2_cipher_suite(pos); 355 355 pos += RSN_SELECTOR_LEN; 356 356 left -= RSN_SELECTOR_LEN; 357 357 } 358 358 } else if (left == 1) { 359 - return _FAIL; 359 + return -EINVAL; 360 360 } 361 - return _SUCCESS; 361 + return 0; 362 362 } 363 363 364 364 int r8712_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len,
+1 -1
drivers/staging/rtl8712/rtl871x_ioctl_linux.c
··· 503 503 Ndis802_11AuthModeWPAPSK; 504 504 } 505 505 if (r8712_parse_wpa2_ie(buf, ielen, &group_cipher, 506 - &pairwise_cipher) == _SUCCESS) { 506 + &pairwise_cipher) == 0) { 507 507 padapter->securitypriv.AuthAlgrthm = 2; 508 508 padapter->securitypriv.ndisauthtype = 509 509 Ndis802_11AuthModeWPA2PSK;