From: "Alexey V. Vissarionov" <gremlin@altlinux.org>
To: Kalle Valo <kvalo@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>,
Raja Mani <rmani@qca.qualcomm.com>,
Suraj Sumangala <surajs@qca.qualcomm.com>,
Vivek Natarajan <nataraja@qca.qualcomm.com>,
Joe Perches <joe@perches.com>,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
lvc-project@linuxtesting.org,
"Alexey V. Vissarionov" <gremlin@altlinux.org>
Subject: [PATCH] ath6kl: minor fix for allocation size
Date: Tue, 17 Jan 2023 14:04:14 +0300 [thread overview]
Message-ID: <20230117110414.GC12547@altlinux.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1026 bytes --]
Although the "param" pointer occupies more or equal space compared
to "*param", the allocation size should use the size of variable
itself.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: bdcd81707973cf8a ("Add ath6kl cleaned up driver")
Signed-off-by: Alexey V. Vissarionov <gremlin@altlinux.org>
diff --git a/drivers/net/wireless/ath/ath6kl/bmi.c b/drivers/net/wireless/ath/ath6kl/bmi.c
index bde5a10d470c8e74..af98e871199d317f 100644
--- a/drivers/net/wireless/ath/ath6kl/bmi.c
+++ b/drivers/net/wireless/ath/ath6kl/bmi.c
@@ -246,7 +246,7 @@ int ath6kl_bmi_execute(struct ath6kl *ar, u32 addr, u32 *param)
return -EACCES;
}
- size = sizeof(cid) + sizeof(addr) + sizeof(param);
+ size = sizeof(cid) + sizeof(addr) + sizeof(*param);
if (size > ar->bmi.max_cmd_size) {
WARN_ON(1);
return -EINVAL;
--
Alexey V. Vissarionov
gremlin ПРИ altlinux ТЧК org; +vii-cmiii-ccxxix-lxxix-xlii
GPG: 0D92F19E1C0DC36E27F61A29CD17E2B43D879005 @ hkp://keys.gnupg.net
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
next reply other threads:[~2023-01-17 11:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-17 11:04 Alexey V. Vissarionov [this message]
2023-01-17 15:24 ` [PATCH] ath6kl: minor fix for allocation size Simon Horman
2023-02-17 16:03 ` Kalle Valo
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=20230117110414.GC12547@altlinux.org \
--to=gremlin@altlinux.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=joe@perches.com \
--cc=kuba@kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=nataraja@qca.qualcomm.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rmani@qca.qualcomm.com \
--cc=surajs@qca.qualcomm.com \
--cc=vthiagar@qca.qualcomm.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;
as well as URLs for NNTP newsgroup(s).