• Johan Hovold's avatar
    USB: serial: mos7840: fix NULL-deref at open · 9e818917
    Johan Hovold authored
    commit 5c75633e upstream.
    
    Fix NULL-pointer dereference in open() should the device lack the
    expected endpoints:
    
    Unable to handle kernel NULL pointer dereference at virtual address 00000030
    ...
    PC is at mos7840_open+0x88/0x8dc [mos7840]
    
    Note that we continue to treat the interrupt-in endpoint as optional for
    now.
    
    Fixes: 3f542974
    
     ("USB: Moschip 7840 USB-Serial Driver")
    Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
    [bwh: Backported to 3.2: add this check to the existing
     usb_serial_driver::attach implementation]
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    9e818917
mos7840.c 77.3 KB