[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD-N9QVhB=C6nKHw4AjfMvZuOA8cGjuYv58nEDwy4eeF-2-iUw@mail.gmail.com>
Date: Mon, 6 Dec 2021 22:09:58 +0800
From: Dongliang Mu <mudongliangabcd@...il.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Hans de Goede <hdegoede@...hat.com>,
Mark Gross <markgross@...nel.org>,
Stephen Boyd <sboyd@...eaurora.org>,
Irina Tirdea <irina.tirdea@...el.com>,
Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
platform-driver-x86@...r.kernel.org,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] driver: pmc_atom: free pmc->regmap when pmc_setup_clks fails
On Mon, Dec 6, 2021 at 10:01 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> On Sun, Dec 05, 2021 at 04:44:19PM +0800, Dongliang Mu wrote:
> > Smatch reports:
> >
> > drivers/platform/x86/pmc_atom.c:496
> > pmc_setup_dev() warn: 'pmc->regmap' not released on lines: 496.
> >
> > Fix this by deallocating pm->regmap when pmc_setup_clks fails.
> >
> > Fixes: 282a4e4ce5f9("platform/x86: Enable Atom PMC platform clocks")
> > Signed-off-by: Dongliang Mu <mudongliangabcd@...il.com>
> > ---
>
> It says v2 in the subject, what is in v2 exactly in comparison to v1?
Sorry to forget to add this information
v1->v2: move iounmap(pmc->regmap); from success path to the error handling code.
>
> ...
>
> > ret = pmc_setup_clks(pdev, pmc->regmap, data);
> > - if (ret)
> > + if (ret) {
> > + iounmap(pmc->regmap);
> > dev_warn(&pdev->dev, "platform clocks register failed: %d\n",
> > ret);
>
> In this case it makes sense to move to
>
> dev_err(&pdev->dev, "platform clocks register failed: %d\n", ret);
>
> > + }
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
Powered by blists - more mailing lists