[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b710ab80-dbf8-a275-0bd5-1fc47d5b9526@i2se.com>
Date: Thu, 22 Dec 2022 20:23:46 +0100
From: Stefan Wahren <stefan.wahren@...e.com>
To: Umang Jain <umang.jain@...asonboard.com>,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-staging@...ts.linux.dev,
linux-rpi-kernel@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Adrien Thierry <athierry@...hat.com>,
Florian Fainelli <f.fainelli@...il.com>,
Dan Carpenter <error27@...il.com>,
Nicolas Saenz Julienne <nsaenz@...nel.org>,
Phil Elwell <phil@...pberrypi.com>,
Dave Stevenson <dave.stevenson@...pberrypi.com>,
Kieran Bingham <kieran.bingham@...asonboard.com>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>
Subject: Re: [PATCH v2 1/4] staging: vc04_services: Stop leaking platform
device on error path
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@...asonboard.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;
> }
>
Powered by blists - more mailing lists