[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230710132001.50764-2-frank.li@vivo.com>
Date: Mon, 10 Jul 2023 21:19:59 +0800
From: Yangtao Li <frank.li@...o.com>
To: Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Helge Deller <deller@....de>, Shawn Guo <shawnguo@...nel.org>,
Fabio Estevam <festevam@...il.com>,
NXP Linux Team <linux-imx@....com>
Cc: Yangtao Li <frank.li@...o.com>, linux-fbdev@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2 2/4] fbdev: imxfb: Convert to devm_kmalloc_array()
No need for manual kfree in the error path and the remove function.
Signed-off-by: Yangtao Li <frank.li@...o.com>
---
drivers/video/fbdev/imxfb.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c
index 385c4715c7b7..7020b5f6434d 100644
--- a/drivers/video/fbdev/imxfb.c
+++ b/drivers/video/fbdev/imxfb.c
@@ -673,7 +673,8 @@ static int imxfb_init_fbinfo(struct platform_device *pdev)
pr_debug("%s\n",__func__);
- info->pseudo_palette = kmalloc_array(16, sizeof(u32), GFP_KERNEL);
+ info->pseudo_palette = devm_kmalloc_array(&pdev->dev, 16,
+ sizeof(u32), GFP_KERNEL);
if (!info->pseudo_palette)
return -ENOMEM;
@@ -1044,7 +1045,6 @@ static int imxfb_probe(struct platform_device *pdev)
failed_ioremap:
failed_getclock:
failed_of_parse:
- kfree(info->pseudo_palette);
failed_init:
framebuffer_release(info);
return ret;
@@ -1061,7 +1061,6 @@ static void imxfb_remove(struct platform_device *pdev)
fb_dealloc_cmap(&info->cmap);
dma_free_wc(&pdev->dev, fbi->map_size, info->screen_buffer,
fbi->map_dma);
- kfree(info->pseudo_palette);
framebuffer_release(info);
}
--
2.39.0
Powered by blists - more mailing lists