diff options
author | Bjørn Mork | 2014-01-12 21:48:53 +0100 |
---|---|---|
committer | Greg Kroah-Hartman | 2014-01-12 20:13:28 -0800 |
commit | f563926fed982f26b391ca42493f55f2447f1b0a (patch) | |
tree | f25186b2329acd71e206d510c01be31ece23aae9 /include | |
parent | 52a6966c350624db89addc3e6a825f5e797a73e4 (diff) |
usb: cdc-wdm: resp_count can be 0 even if WDM_READ is set
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: 8dd5cd5395b9 ("usb: cdc-wdm: avoid hanging on zero length reads")
Cc: <stable@vger.kernel.org> # 3.13
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions