From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: sound/soc/qcom/qdsp6/audioreach.c:212 __audioreach_alloc_pkt() warn: is 'p' large enough for 'struct gpr_pkt'? s32min
Date: Fri, 10 Dec 2021 19:45:48 +0800 [thread overview]
Message-ID: <202112101903.hDp4bziV-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 4518 bytes --]
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
CC: Mark Brown <broonie@kernel.org>
CC: "Pierre-Louis Bossart" <pierre-louis.bossart@linux.intel.com>
Hi Srinivas,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c741e49150dbb0c0aebe234389f4aa8b47958fa8
commit: cf989b68fcadbeeea1446e50fd8b2f24a0f1275c ASoC: qdsp6: audioreach: add Kconfig and Makefile
date: 6 weeks ago
:::::: branch date: 14 hours ago
:::::: commit date: 6 weeks ago
config: riscv-randconfig-m031-20211210 (https://download.01.org/0day-ci/archive/20211210/202112101903.hDp4bziV-lkp(a)intel.com/config)
compiler: riscv64-linux-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
sound/soc/qcom/qdsp6/audioreach.c:212 __audioreach_alloc_pkt() warn: is 'p' large enough for 'struct gpr_pkt'? s32min
sound/soc/qcom/qdsp6/audioreach.c:228 __audioreach_alloc_pkt() warn: is 'p' large enough for 'struct apm_cmd_header'? 0
vim +212 sound/soc/qcom/qdsp6/audioreach.c
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 196
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 197 static void *__audioreach_alloc_pkt(int payload_size, uint32_t opcode, uint32_t token,
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 198 uint32_t src_port, uint32_t dest_port, bool has_cmd_hdr)
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 199 {
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 200 struct gpr_pkt *pkt;
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 201 void *p;
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 202 int pkt_size = GPR_HDR_SIZE + payload_size;
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 203
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 204 if (has_cmd_hdr)
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 205 pkt_size += APM_CMD_HDR_SIZE;
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 206
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 207 p = kzalloc(pkt_size, GFP_KERNEL);
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 208 if (!p)
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 209 return ERR_PTR(-ENOMEM);
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 210
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 211 pkt = p;
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 @212 pkt->hdr.version = GPR_PKT_VER;
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 213 pkt->hdr.hdr_size = GPR_PKT_HEADER_WORD_SIZE;
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 214 pkt->hdr.pkt_size = pkt_size;
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 215 pkt->hdr.dest_port = dest_port;
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 216 pkt->hdr.src_port = src_port;
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 217
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 218 pkt->hdr.dest_domain = GPR_DOMAIN_ID_ADSP;
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 219 pkt->hdr.src_domain = GPR_DOMAIN_ID_APPS;
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 220 pkt->hdr.token = token;
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 221 pkt->hdr.opcode = opcode;
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 222
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 223 if (has_cmd_hdr) {
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 224 struct apm_cmd_header *cmd_header;
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 225
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 226 p = p + GPR_HDR_SIZE;
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 227 cmd_header = p;
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 @228 cmd_header->payload_size = payload_size;
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 229 }
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 230
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 231 return pkt;
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 232 }
44c28dbdb6195b Srinivas Kandagatla 2021-10-26 233
:::::: The code at line 212 was first introduced by commit
:::::: 44c28dbdb6195b2a92e1fcb2946d1e987658f8b5 ASoC: qdsp6: audioreach: add basic pkt alloc support
:::::: TO: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
:::::: CC: Mark Brown <broonie@kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
next reply other threads:[~2021-12-10 11:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-10 11:45 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-04-18 23:49 sound/soc/qcom/qdsp6/audioreach.c:212 __audioreach_alloc_pkt() warn: is 'p' large enough for 'struct gpr_pkt'? s32min kernel test robot
2022-03-19 18:02 kernel test robot
2022-01-20 4:29 kernel test robot
2021-12-10 13:17 kernel test robot
2021-11-25 14:03 kernel test robot
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=202112101903.hDp4bziV-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.