[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Veung3v41RMmBoQHE7TFWUccE2oXsVnNgUt0JE0naTfLw@mail.gmail.com>
Date: Fri, 27 Sep 2019 23:39:22 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Cezary Rojewski <cezary.rojewski@...el.com>,
ALSA Development Mailing List <alsa-devel@...a-project.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jie Yang <yang.jie@...ux.intel.com>,
Mark Brown <broonie@...nel.org>, Takashi Iwai <tiwai@...e.com>,
Kangjie Lu <kjlu@....edu>,
Liam Girdwood <liam.r.girdwood@...ux.intel.com>,
Navid Emamdoost <emamd001@....edu>,
Stephen McCamant <smccaman@....edu>,
Thomas Gleixner <tglx@...utronix.de>,
Enrico Weigelt <info@...ux.net>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Navid Emamdoost <navid.emamdoost@...il.com>
Subject: Re: [alsa-devel] [PATCH v2] ASoC: Intel: Skylake: prevent memory leak
in snd_skl_parse_uuids
On Fri, Sep 27, 2019 at 7:39 PM Pierre-Louis Bossart
<pierre-louis.bossart@...ux.intel.com> wrote:
> > The problem with solution #1 is freeing orphaned pointer. It will work,
> > but it's simple is not okay from object life time prospective.
>
> ?? I don't get your point at all Andy.
> Two allocations happens in a loop and if the second fails, you free the
> first and then jump to free everything allocated in the previous
> iterations. what am I missing?
Two things:
- one allocation is done with kzalloc(), while the other one with
devm_kcalloc()
- due to above the ordering of resources is reversed
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists