alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Re: [alsa-devel] [PATCH] ASoC: Intel: Skylake: prevent memory leak in snd_skl_parse_uuids
       [not found] <20190925040841.29141-1-navid.emamdoost@gmail.com>
@ 2019-09-25 10:48 ` Andy Shevchenko
  0 siblings, 0 replies; only message in thread
From: Andy Shevchenko @ 2019-09-25 10:48 UTC (permalink / raw)
  To: Navid Emamdoost
  Cc: Cezary Rojewski, alsa-devel, Greg Kroah-Hartman, Jie Yang,
	Mark Brown, Takashi Iwai, kjlu, Pierre-Louis Bossart,
	Liam Girdwood, emamd001, smccaman, Thomas Gleixner,
	Enrico Weigelt, linux-kernel

On Tue, Sep 24, 2019 at 11:08:38PM -0500, Navid Emamdoost wrote:
> In snd_skl_parse_uuids if allocation for module->instance_id fails, the
> allocated memory for module shoulde be released.

Since it's using devm_*() for the second allocation it would be cleaner to
either switch it to regular kcalloc() or to switch the first one to
devm_kzalloc(), whatever suits better.

>  		module->instance_id = devm_kzalloc(ctx->dev, size, GFP_KERNEL);
>  		if (!module->instance_id) {

> +			kfree(module);

-- 
With Best Regards,
Andy Shevchenko


_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-25 10:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190925040841.29141-1-navid.emamdoost@gmail.com>
2019-09-25 10:48 ` [alsa-devel] [PATCH] ASoC: Intel: Skylake: prevent memory leak in snd_skl_parse_uuids Andy Shevchenko

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).