drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
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.
Signed-off-by: MalavyaRaval <malavyaraval@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
index 07a6db1d2317..867877413859 100644
--- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
@@ -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;
--
2.43.0
On Thu Mar 19, 2026 at 12:42 PM CDT, MalavyaRaval wrote: > 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. > > Signed-off-by: MalavyaRaval <malavyaraval@gmail.com> You need to put FirstName LastName <email>. ... > - 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
On Thu Mar 19, 2026 at 1:58 PM CDT, Ethan Tidmore wrote: > On Thu Mar 19, 2026 at 12:42 PM CDT, MalavyaRaval wrote: >> 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 >> >> Signed-off-by: MalavyaRaval <malavyaraval@gmail.com>
© 2016 - 2026 Red Hat, Inc.