From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Dongliang Mu <mudongliangabcd@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
Mark Gross <markgross@kernel.org>,
Stephen Boyd <sboyd@codeaurora.org>,
Irina Tirdea <irina.tirdea@intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] driver: pmc_atom: free pmc->regmap when pmc_setup_clks fails
Date: Mon, 6 Dec 2021 16:01:51 +0200 [thread overview]
Message-ID: <Ya4XzxXomi1mCJ8R@smile.fi.intel.com> (raw)
In-Reply-To: <Ya4XbbVnK/0Getmt@smile.fi.intel.com>
On Mon, Dec 06, 2021 at 04:00:13PM +0200, Andy Shevchenko 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@gmail.com>
> > ---
>
> It says v2 in the subject, what is in v2 exactly in comparison to v1?
>
> ...
>
> > 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);
>
> > + }
Also, what about cleaning up debugfs?
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2021-12-06 14:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-05 8:44 Dongliang Mu
2021-12-06 14:00 ` Andy Shevchenko
2021-12-06 14:01 ` Andy Shevchenko [this message]
2021-12-06 14:09 ` Dongliang Mu
2021-12-06 14:05 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Ya4XzxXomi1mCJ8R@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=irina.tirdea@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markgross@kernel.org \
--cc=mudongliangabcd@gmail.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=sboyd@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®