linux/drivers/media/platform/davinci
Johan Hovold 6512c3c39c media: davinci: vpif: fix use-after-free on driver unbind
[ Upstream commit 43acb728bb ]

The driver allocates and registers two platform device structures during
probe, but the devices were never deregistered on driver unbind.

This results in a use-after-free on driver unbind as the device
structures were allocated using devres and would be freed by driver
core when remove() returns.

Fix this by adding the missing deregistration calls to the remove()
callback and failing probe on registration errors.

Note that the platform device structures must be freed using a proper
release callback to avoid leaking associated resources like device
names.

Fixes: 479f7a1181 ("[media] davinci: vpif: adaptions for DT support")
Cc: stable@vger.kernel.org      # 4.12
Cc: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Lad Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-07-12 16:34:57 +02:00
..
ccdc_hw_device.h
dm355_ccdc_regs.h
dm355_ccdc.c
dm644x_ccdc_regs.h
dm644x_ccdc.c
isif_regs.h
isif.c
Kconfig
Makefile
vpbe_display.c
vpbe_osd_regs.h
vpbe_osd.c
vpbe_venc_regs.h
vpbe_venc.c
vpbe.c
vpfe_capture.c media: drivers/media/platform/davinci/vpfe_capture.c : fix typo Proabably > Probably 2021-07-12 09:16:34 +02:00
vpif_capture.c
vpif_capture.h
vpif_display.c
vpif_display.h
vpif.c media: davinci: vpif: fix use-after-free on driver unbind 2022-07-12 16:34:57 +02:00
vpif.h
vpss.c