lkml.org 
[lkml]   [2019]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 193/211] media: b2c2-flexcop-usb: add sanity checking
    Date
    From: Oliver Neukum <oneukum@suse.com>

    commit 1b976fc6d684e3282914cdbe7a8d68fdce19095c upstream.

    The driver needs an isochronous endpoint to be present. It will
    oops in its absence. Add checking for it.

    Reported-by: syzbot+d93dff37e6a89431c158@syzkaller.appspotmail.com
    Signed-off-by: Oliver Neukum <oneukum@suse.com>
    Signed-off-by: Sean Young <sean@mess.org>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/media/usb/b2c2/flexcop-usb.c | 3 +++
    1 file changed, 3 insertions(+)

    --- a/drivers/media/usb/b2c2/flexcop-usb.c
    +++ b/drivers/media/usb/b2c2/flexcop-usb.c
    @@ -537,6 +537,9 @@ static int flexcop_usb_probe(struct usb_
    struct flexcop_device *fc = NULL;
    int ret;

    + if (intf->cur_altsetting->desc.bNumEndpoints < 1)
    + return -ENODEV;
    +
    if ((fc = flexcop_device_kmalloc(sizeof(struct flexcop_usb))) == NULL) {
    err("out of memory\n");
    return -ENOMEM;

    \
     
     \ /
      Last update: 2019-11-27 22:32    [W:4.410 / U:0.052 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site