From: "Patryk Gawroński" <gawronski1.6@gmail.com>
To: gregkh@linuxfoundation.org
Cc: "Patryk Gawroński" <gawronski1.6@gmail.com>,
"Nikolay Kulikov" <nikolayof23@gmail.com>,
"Hans de Goede" <hansg@kernel.org>,
"Michael Straube" <straube.linux@gmail.com>,
"William Hansen-Baird" <william.hansen.baird@gmail.com>,
"Gianmaria Biselli" <gianmariabiselli@gmail.com>,
"Eugene Mavick" <mavick4022@gmail.com>,
"Artur Stupa" <arthur.stupa@gmail.com>,
"Yan Pan" <maxwell2119@163.com>,
"Diksha Kumari" <dikshakdevgan@gmail.com>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH] staging: rtl8723bs: Use pointer type in vzalloc()
Date: Wed, 22 Jul 2026 15:18:25 +0200 [thread overview]
Message-ID: <20260722131827.46975-1-gawronski1.6@gmail.com> (raw)
Update the memory allocation in _rtw_init_sta_priv() to use
sizeof(*pstapriv->pallocated_stainfo_buf) instead of explicitly
passing sizeof(struct sta_info).
This resolves the following checkpatch warning:
"Prefer vzalloc(sizeof(*pstapriv->pallocated_stainfo_buf)...) over
vzalloc(sizeof(struct sta_info)...)"
Using the pointer type is preferred in the kernel as it ensures the
allocated size remains correct even if the pointer's underlying type
changes in the future. The allocation was also split across multiple
lines to comply with column length limits.
Signed-off-by: Patryk Gawroński <gawronski1.6@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 aea660f27959..0758d0540f4b 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(*pstapriv->pallocated_stainfo_buf) * NUM_STA + 4);
if (!pstapriv->pallocated_stainfo_buf)
return _FAIL;
--
2.55.0
next reply other threads:[~2026-07-22 13:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 13:18 Patryk Gawroński [this message]
2026-07-28 7:35 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260722131827.46975-1-gawronski1.6@gmail.com \
--to=gawronski1.6@gmail.com \
--cc=arthur.stupa@gmail.com \
--cc=dikshakdevgan@gmail.com \
--cc=gianmariabiselli@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hansg@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mavick4022@gmail.com \
--cc=maxwell2119@163.com \
--cc=nikolayof23@gmail.com \
--cc=straube.linux@gmail.com \
--cc=william.hansen.baird@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®