提交 428c8d19 编写于 作者: T Trent Piepho 提交者: Mauro Carvalho Chehab

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: NTrent Piepho <xyzzy@speakeasy.org>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 f985c700
......@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册