[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6de50e1a-cb05-8d81-d043-00ed25eda845@linux.vnet.ibm.com>
Date: Fri, 8 Nov 2019 14:37:41 -0600
From: Eddie James <eajames@...ux.vnet.ibm.com>
To: Navid Emamdoost <navid.emamdoost@...il.com>,
jae.hyun.yoo@...ux.intel.com
Cc: linux-aspeed@...ts.ozlabs.org, Andrew Jeffery <andrew@...id.au>,
kjlu@....edu, openbmc@...ts.ozlabs.org,
Eddie James <eajames@...ux.ibm.com>,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
emamd001@....edu, smccaman@....edu,
Mauro Carvalho Chehab <mchehab@...nel.org>,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v3] media: aspeed-video: Fix memory leaks in
aspeed_video_probe
On 10/28/19 12:18 PM, Navid Emamdoost wrote:
> In the implementation of aspeed_video_probe() the allocated memory for
> video should be released if either devm_ioremap_resource()
> or aspeed_video_init() or aspeed_video_setup_video() fails. Replace
> kzalloc() with devm_kzalloc to avoid explicit release for video.
Thanks,
Reviewed-by: Eddie James <eajames@...ux.ibm.com>
>
> Fixes: d2b4387f3bdf ("media: platform: Add Aspeed Video Engine driver")
> Signed-off-by: Navid Emamdoost <navid.emamdoost@...il.com>
> ---
> Changes in v3:
> -- fix call to devm_kzalloc()
> ---
> drivers/media/platform/aspeed-video.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c
> index eb12f3793062..70797b41447c 100644
> --- a/drivers/media/platform/aspeed-video.c
> +++ b/drivers/media/platform/aspeed-video.c
> @@ -1646,7 +1646,8 @@ static int aspeed_video_probe(struct platform_device *pdev)
> {
> int rc;
> struct resource *res;
> - struct aspeed_video *video = kzalloc(sizeof(*video), GFP_KERNEL);
> + struct aspeed_video *video =
> + devm_kzalloc(&pdev->dev, sizeof(*video), GFP_KERNEL);
>
> if (!video)
> return -ENOMEM;
Powered by blists - more mailing lists