]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
media: davinci: vpif_capture: fix memory leak in vpif_probe()
authorYoung Xiao <92siuyang@gmail.com>
Tue, 4 Jun 2019 12:26:33 +0000 (08:26 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 12 Jun 2019 14:46:06 +0000 (10:46 -0400)
commit64f883cd98c6d43013fb0cea788b63e50ebc068c
treef175c156f886f73d7596d494aa3e88f1f4caf77a
parent3510c68d32bf3a188c077b5fb87339379f4e6b43
media: davinci: vpif_capture: fix memory leak in vpif_probe()

If vpif_probe() fails on v4l2_device_register() and vpif_probe_complete(),
then memory allocated at initialize_vpif() for global vpif_obj.dev[i]
become unreleased.

The patch adds deallocation of vpif_obj.dev[i] on the error path.

Signed-off-by: Young Xiao <92siuyang@gmail.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/davinci/vpif_capture.c