On Fri, Jan 17, 2020 at 02:13:56PM +0100, Greg Kroah-Hartman wrote: > On Fri, Jan 17, 2020 at 11:53:17AM +0100, Johan Hovold wrote: > > On Fri, Jan 17, 2020 at 11:36:39AM +0100, Greg Kroah-Hartman wrote: > > > On Fri, Jan 17, 2020 at 10:50:26AM +0100, Johan Hovold wrote: > > > > Check for NULL port data in the event handlers to avoid dereferencing a > > > > NULL pointer in the unlikely case where a port device isn't bound to a > > > > driver (e.g. after an allocation failure on port probe). > > > > > > > > Fixes: f7a33e608d9a ("USB: serial: add quatech2 usb to serial driver") > > > > Cc: stable <stable@xxxxxxxxxxxxxxx> # 3.5 > > > > Signed-off-by: Johan Hovold <johan@xxxxxxxxxx> > > I'll respin this last one in some way, thanks. > > Nah, that's fine, this is ok as-is, thanks. I wasn't too happy with this myself, so I reverted to my first version of simply adding the checks the lsr/msr helper where the actual dereference takes place. The downside is that it's a bit disconnected from where the actual port lookup takes place (qt2_process_read_urb()). But I thinks it's still preferred over adding sanity checks to those event-handler stubs, which admittedly looks quite weird. I've applied the first four and will send a v2 of this one. Johan