aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/usbtest.c
diff options
context:
space:
mode:
authorRoger Quadros <rogerq@ti.com>2013-12-18 05:10:11 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-18 19:26:12 -0500
commit824d752b04765fc513fe17666a539f6c73960c4e (patch)
treecb431745a36ee949556a35393d4c981d9dbb98cf /drivers/usb/misc/usbtest.c
parente5e4746510d140261918aecce2e5e3aa4456f7e9 (diff)
usb: usbtest: Always clear halt else further tests will fail
In test_halt() we set an endpoint halt condition and return on halt verification failure, then the enpoint will remain halted and all further tests related to that enpoint will fail. This is because we don't tackle endpoint halt error condition in any of the tests. To avoid that situation, make sure to clear the halt condition before exiting test_halt(). Signed-off-by: Roger Quadros <rogerq@ti.com> Reviewed-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/misc/usbtest.c')
-rw-r--r--drivers/usb/misc/usbtest.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index 6265c549732b..0317f10823dd 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -1554,8 +1554,17 @@ static int test_halt(struct usbtest_dev *tdev, int ep, struct urb *urb)
1554 return retval; 1554 return retval;
1555 } 1555 }
1556 retval = verify_halted(tdev, ep, urb); 1556 retval = verify_halted(tdev, ep, urb);
1557 if (retval < 0) 1557 if (retval < 0) {
1558 int ret;
1559
1560 /* clear halt anyways, else further tests will fail */
1561 ret = usb_clear_halt(urb->dev, urb->pipe);
1562 if (ret)
1563 ERROR(tdev, "ep %02x couldn't clear halt, %d\n",
1564 ep, ret);
1565
1558 return retval; 1566 return retval;
1567 }
1559 1568
1560 /* clear halt (tests API + protocol), verify it worked */ 1569 /* clear halt (tests API + protocol), verify it worked */
1561 retval = usb_clear_halt(urb->dev, urb->pipe); 1570 retval = usb_clear_halt(urb->dev, urb->pipe);