Skip to content
Commit 3ec7fdc5 authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by Mauro Carvalho Chehab
Browse files

media: usb: msi2500: Fix a possible null-pointer dereference in msi2500_stop_streaming()



In msi2500_stop_streaming(), there is an if statement on line 870 to
check whether dev->udev is NULL:
    if (dev->udev)

When dev->udev is NULL, it is used on line 877:
    msi2500_ctrl_msg(dev, CMD_STOP_STREAMING, 0)
        usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), ...)

Thus, a possible null-pointer dereference may occur.

To fix this bug, dev->udev is checked before calling msi2500_ctrl_msg().

This bug is found by a static analysis tool STCheck written by us.

Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent bf9d46f7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment