Re: [PATCH] ASoC: Intel: Skylake: prevent memory leak in snd_skl_parse_uuids

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux