media: mx2_emmaprp: Fix memleak in emmaprp_probe
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Wed, 26 Aug 2020 09:26:04 +0000 (11:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 08:07:02 +0000 (09:07 +0100)
commit7221d0a05449e469067552eb9e80443a354320ad
tree718e6a468e8cb8657cd02a5d5fb9645b8b9c884b
parentc5da13f02748d20aa5d00cac3172183def38e956
media: mx2_emmaprp: Fix memleak in emmaprp_probe

[ Upstream commit 21d387b8d372f859d9e87fdcc7c3b4a432737f4d ]

When platform_get_irq() fails, we should release
vfd and unregister pcdev->v4l2_dev just like the
subsequent error paths.

Fixes: d4e192cc44914 ("media: mx2_emmaprp: Check for platform_get_irq() error")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/mx2_emmaprp.c