USB: fix urb-poison imbalance
authorJohan Hovold <jhovold@gmail.com>
Thu, 21 Mar 2013 11:36:48 +0000 (12:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Mar 2013 20:48:27 +0000 (13:48 -0700)
commit68a2bed130a10cffbf68620f41d08a900b1d776b
treefc91f52d37ca93f204d389cd7c1d639018221fe3
parent69a3d2125796b3452da1b9fce851af96ac24b3a9
USB: fix urb-poison imbalance

The calls to usb_poison_urb and usb_unpoison_urb are expected to be
balanced. However, if an urb that has not yet been submitted is
poisoned, its reject counter will not be increased as its ep-field is
NULL. A consecutive call to unpoison will thus in fact poison the urb
as its reject counter will be decremented to a negative value,
effectively preventing the urb from being submitted.

Note that there are currently no in-kernel drivers affected by this.

Cc: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/urb.c