diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2009-03-03 18:51:52 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 12:43:03 -0300 |
commit | 428c8d19167c4597adf4d164262c68befafde9bf (patch) | |
tree | 74cfa599a39f69de3ded168a7e343bfa0b520483 /drivers/media/video/v4l2-dev.c | |
parent | f985c7006756cb7da452815d4bf040c02decd044 (diff) | |
download | linux-3.10-428c8d19167c4597adf4d164262c68befafde9bf.tar.gz linux-3.10-428c8d19167c4597adf4d164262c68befafde9bf.tar.bz2 linux-3.10-428c8d19167c4597adf4d164262c68befafde9bf.zip |
V4L/DVB (10791): videodev: not possible to register NULL video_device
video_register_device_index() checks if it was passed a NULL video_device
pointer (which isn't allowed) _after_ it has already dereferenced it with
video_get_drvdata(vdev). The checks are clearly pointless and can be
removed, as the function would have crashed before reaching them if vdev
ever was NULL.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-dev.c')
-rw-r--r-- | drivers/media/video/v4l2-dev.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c index 922b39e79b8..231f5dbb18b 100644 --- a/drivers/media/video/v4l2-dev.c +++ b/drivers/media/video/v4l2-dev.c @@ -366,12 +366,11 @@ int video_register_device_index(struct video_device *vdev, int type, int nr, /* A minor value of -1 marks this video device as never having been registered */ - if (vdev) - vdev->minor = -1; + vdev->minor = -1; /* the release callback MUST be present */ - WARN_ON(!vdev || !vdev->release); - if (!vdev || !vdev->release) + WARN_ON(!vdev->release); + if (!vdev->release) return -EINVAL; /* Part 1: check device type */ |