Skip to contentSkip to conversation

staging: rtl8723bs: break long lines in rtw_sta_mgt.c

PATCH In review MalavyaRaval 2 participants 3 messages Mar 19 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: break long lines in rtw_sta_mgt.c

The original patch attempted to use the preferred sizeof(*ptr) style, but since the target variable is a u8 pointer, this caused a buffer overflow. Reverting to sizeof(struct sta_info) ensures the correct allocation size while satisfying the line-splitting requirement.

---
 drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c +2 -1
index 07a6db1d2317..867877413859 100644
@@ -54,7 +54,8 @@ u32 _rtw_init_sta_priv(struct	sta_priv *pstapriv)
 	struct sta_info *psta;
 	s32 i;
 
-	pstapriv->pallocated_stainfo_buf = vzalloc(sizeof(struct sta_info) * NUM_STA + 4);
+	pstapriv->pallocated_stainfo_buf = vzalloc(sizeof(struct sta_info) *
+						   NUM_STA + 4);
 
 	if (!pstapriv->pallocated_stainfo_buf)
 		return _FAIL;
Signature · 1 line
2.43.0
#1 lore raw
Quoted 6 lines · MalavyaRaval

The original patch attempted to use the preferred sizeof(*ptr) style, but since the target variable is a u8 pointer, this caused a buffer overflow. Reverting to sizeof(struct sta_info) ensures the correct allocation size while satisfying the line-splitting requirement.

You need to put FirstName LastName <email>.

...

drivers/staging/rtl8723bs/core/rtw_sta_mgt.c u32 _rtw_init_sta_priv(struct sta_priv *pstapriv) · line 58

Quoted 3 lines
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c +2 -1
-	pstapriv->pallocated_stainfo_buf = vzalloc(sizeof(struct sta_info) * NUM_STA + 4);
+	pstapriv->pallocated_stainfo_buf = vzalloc(sizeof(struct sta_info) *
+						   NUM_STA + 4);

This just makes the code harder to read.

Thanks,

ET

#2 lore raw
Quoted 5 lines · Ethan Tidmore
Quoted 4 lines · MalavyaRaval

The original patch attempted to use the preferred sizeof(*ptr) style, but since the target variable is a u8 pointer, this caused a buffer overflow. Reverting to sizeof(struct sta_info) ensures the correct allocation size while satisfying the line-splitting requirement.

Also this commit message is totally unrelated to the change.

Thanks,

ET

Quoted 2 lines
Quoted 2 lines