Do not decrement resp_count if it's already 0.
We set resp_count to 0 when the device is closed. The next open and
read will try to clear the WDM_READ flag if there was leftover data
in the read buffer. This fix is necessary to prevent resubmitting
the read URB in a tight loop because resp_count becomes negative.
The bug can easily be triggered from userspace by not reading all
data in the read buffer, and then closing and reopening the chardev.
Fixes:
|
||
|---|---|---|
| .. | ||
| cdc-acm.c | ||
| cdc-acm.h | ||
| cdc-wdm.c | ||
| Kconfig | ||
| Makefile | ||
| usblp.c | ||
| usbtmc.c | ||