All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: wu000273@umn.edu
Cc: kjlu@umn.edu, "Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Hans Verkuil" <hans.verkuil@cisco.com>,
	linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: rcar-vin: Fix a reference count leak.
Date: Tue, 16 Jun 2020 05:13:01 +0300	[thread overview]
Message-ID: <20200616021301.GA29596@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20200613223008.11720-1-wu000273@umn.edu>

Hi Qiushi,

Thank you for the patch.

On Sat, Jun 13, 2020 at 05:30:08PM -0500, wu000273@umn.edu wrote:
> From: Qiushi Wu <wu000273@umn.edu>
> 
> pm_runtime_get_sync() increments the runtime PM usage counter even
> when it returns an error code. Thus call pm_runtime_put_noidle()
> if pm_runtime_get_sync() fails.
> 
> Fixes: 90dedce9bc54 ("media: rcar-vin: add function to manipulate Gen3 chsel value")
> Signed-off-by: Qiushi Wu <wu000273@umn.edu>

This should be squashed with the other patch that you have sent for the
driver, with the exact same subject line. This being said, as commented
on your similar patch for the vsp1 driver, I'd rather see the problem
being fixed inside pm_runtime_get_sync().

> ---
>  drivers/media/platform/rcar-vin/rcar-dma.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c
> index 1a30cd036371..95bc9e0e8792 100644
> --- a/drivers/media/platform/rcar-vin/rcar-dma.c
> +++ b/drivers/media/platform/rcar-vin/rcar-dma.c
> @@ -1392,8 +1392,10 @@ int rvin_set_channel_routing(struct rvin_dev *vin, u8 chsel)
>  	int ret;
>  
>  	ret = pm_runtime_get_sync(vin->dev);
> -	if (ret < 0)
> +	if (ret < 0) {
> +		pm_runtime_put_noidle(vin->dev);
>  		return ret;
> +	}
>  
>  	/* Make register writes take effect immediately. */
>  	vnmc = rvin_read(vin, VNMC_REG);

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2020-06-16  2:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-13 22:30 [PATCH] media: rcar-vin: Fix a reference count leak wu000273
2020-06-16  2:13 ` Laurent Pinchart [this message]
2020-06-13 23:04 wu000273

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=20200616021301.GA29596@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=hans.verkuil@cisco.com \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=niklas.soderlund@ragnatech.se \
    --cc=wu000273@umn.edu \
    /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.