OSDN Git Service

[media] exynos-gsc: don't release a non-dynamically allocated video_device
authorJavier Martinez Canillas <javier@osg.samsung.com>
Fri, 7 Oct 2016 20:39:17 +0000 (17:39 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 16 Nov 2016 18:28:22 +0000 (16:28 -0200)
commitf4ca5030b3a34bc7017c195e89181deaa5ee9a42
tree049371d8d9a38e7471b14656691a0df7dd545cd8
parent652bb68018a557c795db9a24cf8e84280340b38e
[media] exynos-gsc: don't release a non-dynamically allocated video_device

The struct v4l2_device instance for the G-Scaler is not dyanmically
allocated but a member of the struct gsc_dev. In fact, the assigned
.release callback is video_device_release_empty().

But gsc_register_m2m_device() attempts to release the v4l2_device by
calling video_device_release() in its error path. This is wrong since
the v4l2_device wasn't allocated directly and will be freed once its
parent struct gsc_dev is freed.

While being there, rename the remaining goto label in the error path
to something that better explains the error path cleanup.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/exynos-gsc/gsc-m2m.c