All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Dongliang Mu <mudongliangabcd@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	Mark Gross <markgross@kernel.org>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] driver: pmc_atom: free pmc->regmap in pmc_setup_dev
Date: Tue, 30 Nov 2021 17:50:56 +0300	[thread overview]
Message-ID: <20211130145056.GZ18178@kadam> (raw)
In-Reply-To: <20211130143526.1820249-1-mudongliangabcd@gmail.com>

On Tue, Nov 30, 2021 at 10:35:25PM +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.
> 
> CC: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
> ---
>  drivers/platform/x86/pmc_atom.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/platform/x86/pmc_atom.c b/drivers/platform/x86/pmc_atom.c
> index a9d2a4b98e57..95ba108ed716 100644
> --- a/drivers/platform/x86/pmc_atom.c
> +++ b/drivers/platform/x86/pmc_atom.c
> @@ -492,6 +492,7 @@ static int pmc_setup_dev(struct pci_dev *pdev, const struct pci_device_id *ent)
>  		dev_warn(&pdev->dev, "platform clocks register failed: %d\n",
>  			 ret);
>  
> +	iounmap(pmc->regmap);

This releases it on the success path so it will break the driver.

regards,
dan carpenter

>  	pmc->init = true;
>  	return ret;
>  }
> -- 
> 2.25.1

  reply	other threads:[~2021-11-30 14:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30 14:35 [PATCH] driver: pmc_atom: free pmc->regmap in pmc_setup_dev Dongliang Mu
2021-11-30 14:50 ` Dan Carpenter [this message]
2021-12-01  2:02   ` Dongliang Mu

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=20211130145056.GZ18178@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markgross@kernel.org \
    --cc=mudongliangabcd@gmail.com \
    --cc=platform-driver-x86@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.