Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH] sound/soc/sof:Use kmalloc_array instead of kmalloc
@ 2025-09-23 14:25 hariconscious
  2025-10-15 19:08 ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: hariconscious @ 2025-09-23 14:25 UTC (permalink / raw)
  To: lgirdwood, peter.ujfalusi, yung-chuan.liao, ranjani.sridharan,
	daniel.baluta, kai.vehmanen, pierre-louis.bossart
  Cc: shuah, broonie, perex, tiwai, sound-open-firmware, linux-sound,
	linux-kernel, HariKrishna Sagala

From: HariKrishna Sagala <hariconscious@gmail.com>

Documentation/process/deprecated.rst recommends to avoid the use of
kmalloc with dynamic size calculations due to the risk of them
overflowing. This could lead to values wrapping around and a
smaller allocation being made than the caller was expecting.

Replace kmalloc() with kmalloc_array()

Signed-off-by: HariKrishna Sagala <hariconscious@gmail.com>
---
 sound/soc/sof/ipc3-dtrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/sof/ipc3-dtrace.c b/sound/soc/sof/ipc3-dtrace.c
index e5c8fec173c4..6ec391fd39a9 100644
--- a/sound/soc/sof/ipc3-dtrace.c
+++ b/sound/soc/sof/ipc3-dtrace.c
@@ -126,7 +126,7 @@ static int trace_filter_parse(struct snd_sof_dev *sdev, char *string,
 		capacity += TRACE_FILTER_ELEMENTS_PER_ENTRY;
 		entry = strchr(entry + 1, entry_delimiter[0]);
 	}
-	*out = kmalloc(capacity * sizeof(**out), GFP_KERNEL);
+	*out = kmalloc_array(capacity, sizeof(**out), GFP_KERNEL);
 	if (!*out)
 		return -ENOMEM;
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] sound/soc/sof:Use kmalloc_array instead of kmalloc
  2025-09-23 14:25 [PATCH] sound/soc/sof:Use kmalloc_array instead of kmalloc hariconscious
@ 2025-10-15 19:08 ` Mark Brown
  2025-11-06  9:40   ` HariKrishna Sagala
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2025-10-15 19:08 UTC (permalink / raw)
  To: hariconscious
  Cc: lgirdwood, peter.ujfalusi, yung-chuan.liao, ranjani.sridharan,
	daniel.baluta, kai.vehmanen, pierre-louis.bossart, shuah, perex,
	tiwai, sound-open-firmware, linux-sound, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 670 bytes --]

On Tue, Sep 23, 2025 at 07:55:13PM +0530, hariconscious@gmail.com wrote:
> From: HariKrishna Sagala <hariconscious@gmail.com>
> 
> Documentation/process/deprecated.rst recommends to avoid the use of
> kmalloc with dynamic size calculations due to the risk of them
> overflowing. This could lead to values wrapping around and a

Please submit patches using subject lines reflecting the style for the
subsystem, this makes it easier for people to identify relevant patches.
Look at what existing commits in the area you're changing are doing and
make sure your subject lines visually resemble what they're doing.
There's no need to resubmit to fix this alone.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] sound/soc/sof:Use kmalloc_array instead of kmalloc
  2025-10-15 19:08 ` Mark Brown
@ 2025-11-06  9:40   ` HariKrishna Sagala
  2025-11-27  5:05     ` HariKrishna Sagala
  0 siblings, 1 reply; 6+ messages in thread
From: HariKrishna Sagala @ 2025-11-06  9:40 UTC (permalink / raw)
  To: Mark Brown, hariconscious
  Cc: lgirdwood, peter.ujfalusi, yung-chuan.liao, ranjani.sridharan,
	daniel.baluta, kai.vehmanen, pierre-louis.bossart, shuah, perex,
	tiwai, sound-open-firmware, linux-sound, linux-kernel



On Wed, 15 Oct 2025, Mark Brown wrote:

> On Tue, Sep 23, 2025 at 07:55:13PM +0530, hariconscious@gmail.com wrote:
> > From: HariKrishna Sagala <hariconscious@gmail.com>
> >
> > Documentation/process/deprecated.rst recommends to avoid the use of
> > kmalloc with dynamic size calculations due to the risk of them
> > overflowing. This could lead to values wrapping around and a
>
> Please submit patches using subject lines reflecting the style for the
> subsystem, this makes it easier for people to identify relevant patches.
> Look at what existing commits in the area you're changing are doing and
> make sure your subject lines visually resemble what they're doing.
> There's no need to resubmit to fix this alone.
>
Just reminding for an opportunity to check this patch.
Thank you.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] sound/soc/sof:Use kmalloc_array instead of kmalloc
  2025-11-06  9:40   ` HariKrishna Sagala
@ 2025-11-27  5:05     ` HariKrishna Sagala
  2025-11-27 11:12       ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: HariKrishna Sagala @ 2025-11-27  5:05 UTC (permalink / raw)
  To: HariKrishna Sagala, Mark Brown
  Cc: lgirdwood, peter.ujfalusi, yung-chuan.liao, ranjani.sridharan,
	daniel.baluta, kai.vehmanen, pierre-louis.bossart, shuah, perex,
	tiwai, sound-open-firmware, linux-sound, linux-kernel


On Thu, 6 Nov 2025, HariKrishna Sagala wrote:

>
>
> On Wed, 15 Oct 2025, Mark Brown wrote:
>
> > On Tue, Sep 23, 2025 at 07:55:13PM +0530, hariconscious@gmail.com wrote:
> > > From: HariKrishna Sagala <hariconscious@gmail.com>
> > >
> > > Documentation/process/deprecated.rst recommends to avoid the use of
> > > kmalloc with dynamic size calculations due to the risk of them
> > > overflowing. This could lead to values wrapping around and a
> >
> > Please submit patches using subject lines reflecting the style for the
> > subsystem, this makes it easier for people to identify relevant patches.
> > Look at what existing commits in the area you're changing are doing and
> > make sure your subject lines visually resemble what they're doing.
> > There's no need to resubmit to fix this alone.
> >
> Just reminding for an opportunity to check this patch.
> Thank you.
>
Just checking in to see if you had a chance to review this.
If it is missed in the box, please let me know.
Thank you.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] sound/soc/sof:Use kmalloc_array instead of kmalloc
  2025-11-27  5:05     ` HariKrishna Sagala
@ 2025-11-27 11:12       ` Mark Brown
  2025-11-27 12:14         ` HariKrishna Sagala
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2025-11-27 11:12 UTC (permalink / raw)
  To: HariKrishna Sagala
  Cc: lgirdwood, peter.ujfalusi, yung-chuan.liao, ranjani.sridharan,
	daniel.baluta, kai.vehmanen, pierre-louis.bossart, shuah, perex,
	tiwai, sound-open-firmware, linux-sound, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 950 bytes --]

On Thu, Nov 27, 2025 at 10:35:34AM +0530, HariKrishna Sagala wrote:

> Just checking in to see if you had a chance to review this.
> If it is missed in the box, please let me know.

Please don't send content free pings and please allow a reasonable time
for review.  People get busy, go on holiday, attend conferences and so 
on so unless there is some reason for urgency (like critical bug fixes)
please allow at least a couple of weeks for review.  If there have been
review comments then people may be waiting for those to be addressed.

Sending content free pings adds to the mail volume (if they are seen at
all) which is often the problem and since they can't be reviewed
directly if something has gone wrong you'll have to resend the patches
anyway, so sending again is generally a better approach though there are
some other maintainers who like them - if in doubt look at how patches
for the subsystem are normally handled.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] sound/soc/sof:Use kmalloc_array instead of kmalloc
  2025-11-27 11:12       ` Mark Brown
@ 2025-11-27 12:14         ` HariKrishna Sagala
  0 siblings, 0 replies; 6+ messages in thread
From: HariKrishna Sagala @ 2025-11-27 12:14 UTC (permalink / raw)
  To: Mark Brown, HariKrishna Sagala
  Cc: lgirdwood, peter.ujfalusi, yung-chuan.liao, ranjani.sridharan,
	daniel.baluta, kai.vehmanen, pierre-louis.bossart, shuah, perex,
	tiwai, sound-open-firmware, linux-sound, linux-kernel


On Thu, 27 Nov 2025, Mark Brown wrote:

> On Thu, Nov 27, 2025 at 10:35:34AM +0530, HariKrishna Sagala wrote:
>
> > Just checking in to see if you had a chance to review this.
> > If it is missed in the box, please let me know.
>
> Please don't send content free pings and please allow a reasonable time
> for review.  People get busy, go on holiday, attend conferences and so
> on so unless there is some reason for urgency (like critical bug fixes)
> please allow at least a couple of weeks for review.  If there have been
> review comments then people may be waiting for those to be addressed.
>
> Sending content free pings adds to the mail volume (if they are seen at
> all) which is often the problem and since they can't be reviewed
> directly if something has gone wrong you'll have to resend the patches
> anyway, so sending again is generally a better approach though there are
> some other maintainers who like them - if in doubt look at how patches
> for the subsystem are normally handled.
>

Thank you for the clarification and the expected review cadence.
I understand people will be busy with the commitments.
Sorry for reminding for a non-critical patch but I followed-up after 2
weeks.

I will resend the patch as per the subsystem style.
I didn't send this earlier as I followed as per suggestion not to send the
patch again for only a commit message change.
Going forward I will avoid this and allow reasonable time for review
unless a change is urgent.

Thank you for the guidance.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-11-27 12:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-23 14:25 [PATCH] sound/soc/sof:Use kmalloc_array instead of kmalloc hariconscious
2025-10-15 19:08 ` Mark Brown
2025-11-06  9:40   ` HariKrishna Sagala
2025-11-27  5:05     ` HariKrishna Sagala
2025-11-27 11:12       ` Mark Brown
2025-11-27 12:14         ` HariKrishna Sagala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox