diff options
author | Antonio Ospite <ospite@studenti.unina.it> | 2011-10-12 16:59:26 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-10-19 07:48:08 -0400 |
commit | e58fced201ad6e6cb673f07499919c3b20792d94 (patch) | |
tree | 7db4aac4f1380e15a8c0442e74634db99ef39636 /drivers/media | |
parent | 899e3ee404961a90b828ad527573aaaac39f0ab1 (diff) |
[media] videodev: fix a NULL pointer dereference in v4l2_device_release()
The change in 8280b66 does not cover the case when v4l2_dev is already
NULL, fix that.
With a Kinect sensor, seen as an USB camera using GSPCA in this context,
a NULL pointer dereference BUG can be triggered by just unplugging the
device after the camera driver has been loaded.
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/v4l2-dev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c index d72156517726..a5c9ed128b97 100644 --- a/drivers/media/video/v4l2-dev.c +++ b/drivers/media/video/v4l2-dev.c | |||
@@ -181,7 +181,7 @@ static void v4l2_device_release(struct device *cd) | |||
181 | * TODO: In the long run all drivers that use v4l2_device should use the | 181 | * TODO: In the long run all drivers that use v4l2_device should use the |
182 | * v4l2_device release callback. This check will then be unnecessary. | 182 | * v4l2_device release callback. This check will then be unnecessary. |
183 | */ | 183 | */ |
184 | if (v4l2_dev->release == NULL) | 184 | if (v4l2_dev && v4l2_dev->release == NULL) |
185 | v4l2_dev = NULL; | 185 | v4l2_dev = NULL; |
186 | 186 | ||
187 | /* Release video_device and perform other | 187 | /* Release video_device and perform other |