![]() |
|
Message-ID: <lcaqr52jf5texgoro2mm5kegykgwaifq45m6gkln47tg7fjv4r@4cxw374tspnj> Date: Sat, 8 Feb 2025 22:43:26 -0500 From: Ethan Carter Edwards <ethan@...ancedwards.com> To: Srinivas Kandagatla <srinivas.kandagatla@...aro.org> Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "linux-hardening@...r.kernel.org" <linux-hardening@...r.kernel.org>, "kernel-hardening@...ts.openwall.com" <kernel-hardening@...ts.openwall.com>, linux-sound@...r.kernel.org, linux-arm-msm@...r.kernel.org, Takashi Iwai <tiwai@...e.com> Subject: Re: [PATCH] ASoC: q6dsp: q6apm: change kzalloc to kcalloc I wanted to check in on this. Anything I need to change? Thanks, Ethan On 25/01/19 08:32PM, Ethan Carter Edwards wrote: > We are replacing any instances of kzalloc(size * count, ...) with > kcalloc(count, size, ...) due to risk of overflow [1]. > > [1] https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments > Link: https://github.com/KSPP/linux/issues/162 > > Signed-off-by: Ethan Carter Edwards <ethan@...ancedwards.com> > --- > sound/soc/qcom/qdsp6/q6apm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c > index 2a2a5bd98110..11e252a70f69 100644 > --- a/sound/soc/qcom/qdsp6/q6apm.c > +++ 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); > if (!buf) { > mutex_unlock(&graph->lock); > return -ENOMEM; > -- > 2.48.0 >
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.