[media] v4l: Make sure we hold a reference to the v4l2_device before using it
authorDave Young <hidave.darkstar@gmail.com>
Tue, 6 Sep 2011 12:08:08 +0000 (09:08 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 22 Sep 2011 01:17:53 +0000 (22:17 -0300)
commit236c5441d70312242b5b32d229259930046a80e5
tree45575f4f3e36ce88299baf99991b8998a10a00ee
parent8280b662df96f4172c4972b14a4aec0daf272b8f
[media] v4l: Make sure we hold a reference to the v4l2_device before using it

v4l2_device_disconnect() calls dev_get_drvdata() and dev_set_drvdata()
on the device it received in v4l2_device_register(). Get a reference to
the device in v4l2_device_register() to make sure it won't disappear as
long as we need it.

Reported-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Tested-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/v4l2-device.c