From 6d41087491368f8ac8e0616bb27cdd5797b42d1a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 25 Apr 2015 12:16:22 -0600 Subject: [PATCH] Fixes some crashes when the hub is removed and/or reinserted --- arch/arm/src/lpc17xx/lpc17_usbhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/src/lpc17xx/lpc17_usbhost.c b/arch/arm/src/lpc17xx/lpc17_usbhost.c index 11543bb92e..959b57342a 100644 --- a/arch/arm/src/lpc17xx/lpc17_usbhost.c +++ b/arch/arm/src/lpc17xx/lpc17_usbhost.c @@ -3105,7 +3105,7 @@ static int lpc17_cancel(FAR struct usbhost_driver_s *drvr, usbhost_ep_t ep) { /* We really need some kind of atomic test and set to do this right */ - td = (struct lpc17_gtd_s *)ed->hw.headp; + td = (struct lpc17_gtd_s *)(ed->hw.headp & ED_HEADP_ADDR_MASK); ed->hw.headp = LPC17_TDTAIL_ADDR; ed->asynch = NULL;