mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 00:22:00 +02:00
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: d74d4e2359 ("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>
This commit is contained in:
parent
cc2f92dfd3
commit
c2b96a6818
|
|
@ -3912,6 +3912,7 @@ static int allegro_probe(struct platform_device *pdev)
|
|||
if (ret < 0) {
|
||||
v4l2_err(&dev->v4l2_dev,
|
||||
"failed to request firmware: %d\n", ret);
|
||||
v4l2_device_unregister(&dev->v4l2_dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user