Re: [PATCH v2] USB: serial: quatech2: handle unbound ports

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 17, 2020 at 03:35:26PM +0100, Johan Hovold wrote:
> Check for NULL port data in the modem- and line-status 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).
> 
> Note that the other (stubbed) event handlers qt2_process_xmit_empty()
> and qt2_process_flush() would need similar sanity checks in case they
> are ever implemented.
> 
> Fixes: f7a33e608d9a ("USB: serial: add quatech2 usb to serial driver")
> Cc: stable <stable@xxxxxxxxxxxxxxx>     # 3.5
> Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
> ---
> 
> v2
>  - move sanity checks to where the actual dereferences take place
>  - drop sanity checks from the stubbed event handlers

Looks good, thanks for the rewrite:

Reviewed-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux