staging: rtl8723bs: break long lines in rtw_sta_mgt.c
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
@@ -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
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 tosizeof(struct sta_info)ensures the correct allocation size while satisfying the line-splitting requirement.Signed-off-by MalavyaRaval <[email protected]>
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
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 tosizeof(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
Signed-off-by MalavyaRaval <[email protected]>