staging: rtl8712: r8712_tkip_decrypt(): Change return type
authorNishka Dasgupta <nishkadg.linux@gmail.com>
Fri, 2 Aug 2019 06:42:09 +0000 (12:12 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Aug 2019 12:00:56 +0000 (14:00 +0200)
Change return type of r8712_tkip_decrypt from u8 to void as the
return value is never used. Modify or remove return statements
accordingly.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190802064212.30476-6-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/rtl871x_security.c
drivers/staging/rtl8712/rtl871x_security.h

index 693008bba83ea5661f60e91a7e26105a9825c7af..66586a9d9f7355c7ee64c5788bc6297fd5d0f6e1 100644 (file)
@@ -636,7 +636,7 @@ u32 r8712_tkip_encrypt(struct _adapter *padapter, u8 *pxmitframe)
 }
 
 /* The hlen doesn't include the IV */
-u32 r8712_tkip_decrypt(struct _adapter *padapter, u8 *precvframe)
+void r8712_tkip_decrypt(struct _adapter *padapter, u8 *precvframe)
 {      /* exclude ICV */
        u16 pnl;
        u32 pnh;
@@ -670,7 +670,7 @@ u32 r8712_tkip_decrypt(struct _adapter *padapter, u8 *precvframe)
                                prwskey = &psecuritypriv->XGrpKey[
                                         ((idx >> 6) & 0x3) - 1].skey[0];
                                if (!psecuritypriv->binstallGrpkey)
-                                       return _FAIL;
+                                       return;
                        } else {
                                prwskey = &stainfo->x_UncstKey.skey[0];
                        }
@@ -686,16 +686,8 @@ u32 r8712_tkip_decrypt(struct _adapter *padapter, u8 *precvframe)
                        arcfour_encrypt(&mycontext, payload, payload, length);
                        *((__le32 *)crc) = cpu_to_le32(getcrc32(payload,
                                        length - 4));
-                       if (crc[3] != payload[length - 1] ||
-                           crc[2] != payload[length - 2] ||
-                           crc[1] != payload[length - 3] ||
-                           crc[0] != payload[length - 4])
-                               return _FAIL;
-               } else {
-                       return _FAIL;
                }
        }
-       return _SUCCESS;
 }
 
 /* 3 =====AES related===== */
index 25b4d379766dcb093873712731c83ebd9839cf2d..25220afa61e93eec7353abcb7a5add874ccfbc94 100644 (file)
@@ -210,7 +210,7 @@ u32 r8712_aes_encrypt(struct _adapter *padapter, u8 *pxmitframe);
 u32 r8712_tkip_encrypt(struct _adapter *padapter, u8 *pxmitframe);
 void r8712_wep_encrypt(struct _adapter *padapter, u8  *pxmitframe);
 u32 r8712_aes_decrypt(struct _adapter *padapter, u8  *precvframe);
-u32 r8712_tkip_decrypt(struct _adapter *padapter, u8  *precvframe);
+void r8712_tkip_decrypt(struct _adapter *padapter, u8  *precvframe);
 void r8712_wep_decrypt(struct _adapter *padapter, u8  *precvframe);
 void r8712_use_tkipkey_handler(struct timer_list *t);