From: Markus Elfring <Markus.Elfring@web.de>
To: Ethan Carter Edwards <ethan@ethancedwards.com>,
linux-sound@vger.kernel.org, linux-hardening@vger.kernel.org,
linux-arm-msm@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>,
Jaroslav Kysela <perex@perex.cz>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
Takashi Iwai <tiwai@suse.com>
Subject: Re: [PATCH v2?] ASoC: q6dsp: q6apm: replace kzalloc() with kcalloc() in q6apm_map_memory_regions()
Date: Sun, 23 Feb 2025 10:50:08 +0100 [thread overview]
Message-ID: <c8cb0a78-c547-41dc-ac35-d569c57ebe3c@web.de> (raw)
In-Reply-To: <20250222-q6apm-kcalloc-v1-1-6f09dae6c31c@ethancedwards.com>
…
> We are trying to get rid of all multiplications from allocation
> functions to prevent integer overflows[1]. …
Is an imperative wording more desirable for such a change description?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.14-rc3#n94
…
> ---
> sound/soc/qcom/qdsp6/q6apm.c | 2 +-
…
How do you think about to improve your version management?
https://lore.kernel.org/all/?q=%22This+looks+like+a+new+version+of+a+previously+submitted+patch%22
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.14-rc3#n780
…
> +++ b/sound/soc/qcom/qdsp6/q6apm.c
> @@ -230,7 +230,7 @@ int q6apm_map_memory_regions(struct q6apm_graph *graph, unsigned int dir, phys_a
> return 0;
> }
>
> - buf = kzalloc(((sizeof(struct audio_buffer)) * periods), GFP_KERNEL);
> + buf = kcalloc(periods, sizeof(struct audio_buffer), GFP_KERNEL);
…
See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.14-rc3#n941
How do you think about to increase the application of scope-based resource management?
Regards,
Markus
next prev parent reply other threads:[~2025-02-23 9:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-22 19:55 [PATCH] ASoC: q6dsp: q6apm: replace kzalloc() with kcalloc() in q6apm_map_memory_regions() Ethan Carter Edwards
2025-02-23 9:50 ` Markus Elfring [this message]
2025-02-24 13:10 ` [PATCH v2?] " Mark Brown
2025-02-24 17:06 ` [PATCH] " Dmitry Baryshkov
2025-02-25 15:23 ` Mark Brown
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=c8cb0a78-c547-41dc-ac35-d569c57ebe3c@web.de \
--to=markus.elfring@web.de \
--cc=broonie@kernel.org \
--cc=ethan@ethancedwards.com \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=srinivas.kandagatla@linaro.org \
--cc=tiwai@suse.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