Skip to content

Commit 8c964b8

Browse files
Lin YuChengregkh
authored andcommitted
staging: rtl8723bs: initialize le_tmp64 in rtw_BIP_verify()
Initialize le_tmp64 to zero in rtw_BIP_verify() to prevent using uninitialized data. Smatch warns that only 6 bytes are copied to this 8-byte (u64) variable, leaving the last two bytes uninitialized: drivers/staging/rtl8723bs/core/rtw_security.c:1308 rtw_BIP_verify() warn: not copying enough bytes for '&le_tmp64' (8 vs 6 bytes) Initializing the variable at the start of the function fixes this warning and ensures predictable behavior. Fixes: 554c0a3 ("staging: Add rtl8723bs sdio wifi driver") Cc: stable <stable@kernel.org> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/linux-staging/abvwIQh0CHTp4wNJ@stanley.mountain/ Signed-off-by: Lin YuChen <starpt.official@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://patch.msgid.link/20260320172502.167332-1-starpt.official@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3fc7b93 commit 8c964b8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/staging/rtl8723bs/core/rtw_security.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 *precvframe)
12851285
u8 mic[16];
12861286
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
12871287
__le16 le_tmp;
1288-
__le64 le_tmp64;
1288+
__le64 le_tmp64 = 0;
12891289

12901290
ori_len = pattrib->pkt_len - WLAN_HDR_A3_LEN + BIP_AAD_SIZE;
12911291
BIP_AAD = kzalloc(ori_len, GFP_KERNEL);

0 commit comments

Comments
 (0)