Skip to contentSkip to conversation

staging: rtl8723bs: split multiple assignment in rtw_mgmt_xmitframe_coalesce

PATCH New Marco Antonio Solis Segura 1 participant 1 message Mar 19 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: split multiple assignment in rtw_mgmt_xmitframe_coalesce

Cleanup the multiple assignment of tmp_buf and BIP_AAD to fix the checkpatch.pl CHECK: "Multiple assignments should be avoided".

Additionally, reorder the assignments to ensure tmp_buf is assigned only after BIP_AAD has been validated as non-NULL.

---
 drivers/staging/rtl8723bs/core/rtw_xmit.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_xmit.c +3 -2
index 19758e2f5903..d75f60efb7b6 100644
@@ -1194,12 +1194,13 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, s
 	pwlanhdr = (struct ieee80211_hdr *)pframe;
 
 	ori_len = BIP_AAD_SIZE + pattrib->pktlen;
-	tmp_buf = BIP_AAD = kzalloc(ori_len, GFP_ATOMIC);
-	subtype = GetFrameSubType(pframe); /* bit(7)~bit(2) */
+	BIP_AAD = kzalloc(ori_len, GFP_ATOMIC);
 
 	if (!BIP_AAD)
 		return _FAIL;
 
+	tmp_buf = BIP_AAD;
+	subtype = GetFrameSubType(pframe); /* bit(7)~bit(2) */
 	spin_lock_bh(&padapter->security_key_mutex);
 
 	/* only support station mode */
Signature · 1 line
2.53.0