]> git.baikalelectronics.ru Git - kernel.git/commit
media: s5p-g2d: Fix a memory leak in an error handling path in 'g2d_probe()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 25 Jun 2020 20:19:47 +0000 (22:19 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sun, 19 Jul 2020 06:14:00 +0000 (08:14 +0200)
commitc95023690471c4c0c82285aac64a1efd758644f3
tree5ade3eb3b19ef32fc5cb5a0c52a49b9b5d5c6944
parent7d58b2c21292803125aaaa7c797b1d0ed864553f
media: s5p-g2d: Fix a memory leak in an error handling path in 'g2d_probe()'

Memory allocated with 'v4l2_m2m_init()' must be freed by a corresponding
call to 'v4l2_m2m_release()'

Also reorder the code at the end of the probe function so that
'video_register_device()' is called last.
Update the error handling path accordingly.

Fixes: 17fc0da9027e ("[media] s5p-g2d: Add DT based discovery support")
Fixes: f77641f84555 ("[media] v4l: add G2D driver for s5p device family")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil-cisco@xs4all.nl: checkpatch: align with parenthesis]
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/s5p-g2d/g2d.c