]> www.infradead.org Git - users/jedix/linux-maple.git/commit
media: platform: allgro-dvt: unregister v4l2_device on the error path
authorJoe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Thu, 5 Dec 2024 02:06:21 +0000 (11:06 +0900)
committerHans Verkuil <hverkuil@xs4all.nl>
Sat, 22 Feb 2025 10:12:59 +0000 (11:12 +0100)
commitc2b96a6818159fba8a3bcc38262da9e77f9b3ec7
tree9ee9685482e6e60a4618ce3ae79fe5850e04d131
parentcc2f92dfd304d5106c669859f95866f689fd68f9
media: platform: allgro-dvt: unregister v4l2_device on the error path

In allegro_probe(), the v4l2 device is not unregistered in the error
path, which results in a memory leak. Fix it by calling
v4l2_device_unregister() before returning error.

Fixes: d74d4e2359ec ("media: allegro: move driver out of staging")
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/platform/allegro-dvt/allegro-core.c