linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Wahren <stefan.wahren@i2se.com>
To: Umang Jain <umang.jain@ideasonboard.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-staging@lists.linux.dev,
	linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Adrien Thierry <athierry@redhat.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Dan Carpenter <error27@gmail.com>,
	Nicolas Saenz Julienne <nsaenz@kernel.org>,
	Phil Elwell <phil@raspberrypi.com>,
	Dave Stevenson <dave.stevenson@raspberrypi.com>,
	Kieran Bingham <kieran.bingham@ideasonboard.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [PATCH v2 1/4] staging: vc04_services: Stop leaking platform device on error path
Date: Thu, 22 Dec 2022 20:23:46 +0100	[thread overview]
Message-ID: <b710ab80-dbf8-a275-0bd5-1fc47d5b9526@i2se.com> (raw)
In-Reply-To: <20221222191500.515795-2-umang.jain@ideasonboard.com>

Hi Umang,

Am 22.12.22 um 20:14 schrieb Umang Jain:
> vchiq driver registers the child platform devices in
> vchiq_register_child(). However, in the registration error code path,
> currently the driver is leaking platform devices by not destroying the
> return platform device. Plug this leak using platform_device_put() as
> mentioned in the documentation for platform_device_register().
>
> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
>   drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> index dc33490ba7fb..fc7ea7ba97b2 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> @@ -1779,6 +1779,7 @@ vchiq_register_child(struct platform_device *pdev, const char *name)
>   	child = platform_device_register_full(&pdevinfo);
>   	if (IS_ERR(child)) {
>   		dev_warn(&pdev->dev, "%s not registered\n", name);
> +		platform_device_put(child);
why should we free an error?
>   		child = NULL;
>   	}
>   

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-12-22 19:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-22 19:14 [PATCH v2 0/4] staging: vchiq: Rework child platform device (un)register Umang Jain
2022-12-22 19:14 ` [PATCH v2 1/4] staging: vc04_services: Stop leaking platform device on error path Umang Jain
2022-12-22 19:23   ` Stefan Wahren [this message]
2022-12-22 20:30   ` Laurent Pinchart
2022-12-23  5:28     ` Umang Jain
2022-12-22 19:14 ` [PATCH v2 2/4] staging: vchiq: Do not assign default dma_mask explicitly Umang Jain
2022-12-22 19:14 ` [PATCH v2 3/4] staging: vchiq: Simplify platform devices registration Umang Jain
2022-12-22 19:15 ` [PATCH v2 4/4] staging: vchiq: Rework child platform device (un)register Umang Jain
2022-12-22 19:26 ` [PATCH v2 0/4] " Stefan Wahren

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=b710ab80-dbf8-a275-0bd5-1fc47d5b9526@i2se.com \
    --to=stefan.wahren@i2se.com \
    --cc=athierry@redhat.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=error27@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=nsaenz@kernel.org \
    --cc=phil@raspberrypi.com \
    --cc=umang.jain@ideasonboard.com \
    /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;
as well as URLs for NNTP newsgroup(s).