lkml.org 
[lkml]   [2020]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] media: s5p-g2d: Fix a memory leak in an error handling path in 'g2d_probe()'
Date
Memory allocated with 'v4l2_m2m_init()' must be freed by a corresponding
call to 'v4l2_m2m_release()'

Fixes: 5ce60d790a24 ("[media] s5p-g2d: Add DT based discovery support")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/media/platform/s5p-g2d/g2d.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/s5p-g2d/g2d.c b/drivers/media/platform/s5p-g2d/g2d.c
index 6932fd47071b..ded6fa24677c 100644
--- a/drivers/media/platform/s5p-g2d/g2d.c
+++ b/drivers/media/platform/s5p-g2d/g2d.c
@@ -717,12 +717,14 @@ static int g2d_probe(struct platform_device *pdev)
of_id = of_match_node(exynos_g2d_match, pdev->dev.of_node);
if (!of_id) {
ret = -ENODEV;
- goto unreg_video_dev;
+ goto free_m2m;
}
dev->variant = (struct g2d_variant *)of_id->data;

return 0;

+free_m2m:
+ v4l2_m2m_release(dev->m2m_dev);
unreg_video_dev:
video_unregister_device(dev->vfd);
rel_vdev:
--
2.25.1
\
 
 \ /
  Last update: 2020-04-26 22:07    [W:0.046 / U:6.896 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site