Skip to contentSkip to conversation

pxa168fb: fix release function mismatch in probe failure

PATCH In review Chuhong Yuan 2 participants 2 messages Dec 5, 2019 – Jan 15, 2020 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pxa168fb: fix release function mismatch in probe failure

The driver uses kfree() to release the resource allocated by framebuffer_alloc(), which does not match.
Use framebuffer_release() instead to fix it.

Fixes 638772c7553f ("fb: add support of LCD display controller on pxa168/910 (base layer)")
---
 drivers/video/fbdev/pxa168fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/pxa168fb.c +1 -1
index 1410f476e135..b9435133b6f3 100644
@@ -769,7 +769,7 @@ static int pxa168fb_probe(struct platform_device *pdev)
 	dma_free_coherent(fbi->dev, info->fix.smem_len,
 			info->screen_base, fbi->fb_start_dma);
 failed_free_info:
-	kfree(info);
+	framebuffer_release(info);
 
 	dev_err(&pdev->dev, "frame buffer device init failed with %d\n", ret);
 	return ret;
Signature · 1 line
2.24.0
#1 lore raw
Quoted 3 lines · Chuhong Yuan

The driver uses kfree() to release the resource allocated by framebuffer_alloc(), which does not match.
Use framebuffer_release() instead to fix it.

For pxa168fb driver framebuffer_release() does only kfree() so there is no real breakage currently. Lets fix it anyway so it won't break in the future.

Quoted 2 lines
Fixes 638772c7553f ("fb: add support of LCD display controller on pxa168/910 (base layer)")

Patch queued for v5.6, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

Quoted 18 lines
---
 drivers/video/fbdev/pxa168fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/pxa168fb.c +1 -1
index 1410f476e135..b9435133b6f3 100644
@@ -769,7 +769,7 @@ static int pxa168fb_probe(struct platform_device *pdev)
 	dma_free_coherent(fbi->dev, info->fix.smem_len,
 			info->screen_base, fbi->fb_start_dma);
 failed_free_info:
-	kfree(info);
+	framebuffer_release(info);
 
 	dev_err(&pdev->dev, "frame buffer device init failed with %d\n", ret);
 	return ret;