[v2,1/4] fbdev: imxfb: Removed unneeded release_mem_region

Message ID 20230710132001.50764-1-frank.li@vivo.com
State New
Headers
Series [v2,1/4] fbdev: imxfb: Removed unneeded release_mem_region |

Commit Message

李扬韬 July 10, 2023, 1:19 p.m. UTC
  Remove unnecessary release_mem_region from the error path to prevent
mem region from being released twice, which could avoid resource leak
or other unexpected issues.

Fixes: b083c22d5114 ("video: fbdev: imxfb: Convert request_mem_region + ioremap to devm_ioremap_resource")
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/video/fbdev/imxfb.c | 1 -
 1 file changed, 1 deletion(-)
  

Comments

Helge Deller July 11, 2023, 5:29 a.m. UTC | #1
On 7/10/23 15:19, Yangtao Li wrote:
> Remove unnecessary release_mem_region from the error path to prevent
> mem region from being released twice, which could avoid resource leak
> or other unexpected issues.
>
> Fixes: b083c22d5114 ("video: fbdev: imxfb: Convert request_mem_region + ioremap to devm_ioremap_resource")
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

I've applied that series (and fixed minor grammar typos in the commit logs).

Thanks!
Helge

> ---
>   drivers/video/fbdev/imxfb.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c
> index 04f3bf30a529..385c4715c7b7 100644
> --- a/drivers/video/fbdev/imxfb.c
> +++ b/drivers/video/fbdev/imxfb.c
> @@ -1043,7 +1043,6 @@ static int imxfb_probe(struct platform_device *pdev)
>   failed_map:
>   failed_ioremap:
>   failed_getclock:
> -	release_mem_region(res->start, resource_size(res));
>   failed_of_parse:
>   	kfree(info->pseudo_palette);
>   failed_init:
  

Patch

diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c
index 04f3bf30a529..385c4715c7b7 100644
--- a/drivers/video/fbdev/imxfb.c
+++ b/drivers/video/fbdev/imxfb.c
@@ -1043,7 +1043,6 @@  static int imxfb_probe(struct platform_device *pdev)
 failed_map:
 failed_ioremap:
 failed_getclock:
-	release_mem_region(res->start, resource_size(res));
 failed_of_parse:
 	kfree(info->pseudo_palette);
 failed_init: