]> git.baikalelectronics.ru Git - kernel.git/commit
media: tw686x: Fix memory leak in tw686x_video_init
authorMiaoqian Lin <linmq006@gmail.com>
Tue, 21 Jun 2022 05:30:30 +0000 (06:30 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 27 Jun 2022 08:24:45 +0000 (09:24 +0100)
commit65eec6a3fdb24b1b66db5c2e97a0b97d050f0a62
treefe9b343c78b66a3616e0486a450c43fb2435b90d
parent1f05ce6db72ac5a46e10097417758392c2dd518c
media: tw686x: Fix memory leak in tw686x_video_init

video_device_alloc() allocates memory for vdev,
when video_register_device() fails, it doesn't release the memory and
leads to memory leak, call video_device_release() to fix this.

Fixes: c41b31632ca0 ("[media] media: Support Intersil/Techwell TW686x-based video capture cards")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/pci/tw686x/tw686x-video.c