[media] s5p-jpeg: Eliminate double kfree()
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Fri, 3 Jul 2015 10:04:38 +0000 (07:04 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 11 Aug 2015 09:26:14 +0000 (06:26 -0300)
commit7a1d4e7c064c0eddd90f0204cecd294d0dc5b36a
treee206015d9ee026572683da3a4f41d8b80476e471
parent1af21985473d72965807ef5e5cc02528aa8c01e4
[media] s5p-jpeg: Eliminate double kfree()

video_unregister_device() calls device_unregister(), which calls
put_device(), which calls kobject_put(), and if this is the last reference
then kobject_release() is called, which calls kobject_cleanup(), which
calls ktype's release method which happens to be device_release() in this
case, which calls dev->release(), which happens to be
v4l2_device_release() in this case, which calls vdev->release(), which
happens to be video_device_release(). But video_device_release() is
called explicitly both in error recovery path of s5p_jpeg_probe() and
in s5p_jpeg_remove(). The pointers in question are not nullified between
the two calls, so this is harmful.

This patch fixes the driver so that video_device_release() is not called
twice for the same object.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/platform/s5p-jpeg/jpeg-core.c
This page took 0.027152 seconds and 5 git commands to generate.