lkml.org 
[lkml]   [2019]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ASoC: Intel: Skylake: prevent memory leak in snd_skl_parse_uuids
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


\
 
 \ /
  Last update: 2019-09-25 12:49    [W:0.036 / U:1.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site