USB: serial: digi_acceleport: add chars_in_buffer locking
authorJohan Hovold <johan@kernel.org>
Wed, 19 May 2021 09:20:02 +0000 (11:20 +0200)
committerJohan Hovold <johan@kernel.org>
Fri, 21 May 2021 13:46:02 +0000 (15:46 +0200)
commitdcbc0ae4f8fcdd4c873e7a9bac49ab84b0453813
treed34c5782a7773bbf649ebb00f4129ea8263b6be3
parent3aed3af202aa2f8246d07875809b9bc07a02131b
USB: serial: digi_acceleport: add chars_in_buffer locking

Both the dp_write_urb_in_use flag and dp_out_buf_len counter should be
accessed while holding the driver port lock. Add the missing locking to
chars_in_buffer and clean up the implementation somewhat by using a
common exit path.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/digi_acceleport.c