summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2013-05-05 07:17:16 +0800
committerBernard Xiong <[email protected]>2013-05-05 07:17:16 +0800
commit1161e7b3f87914f941900e08807a70c99b36f1a5 (patch)
tree4f3c1d806df4a03768c747ceb8b1a7a993131b2b /components
parent0e16b6dc972c64396b87258a6bd361cfc8a486aa (diff)
parentab3e00cc21710aef4369c04e8a3ac7882d5a0c28 (diff)
Merge branch 'master' of https://github.com/RT-Thread/rt-thread
Diffstat (limited to 'components')
-rw-r--r--components/drivers/usb/usbdevice/core/core.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/components/drivers/usb/usbdevice/core/core.c b/components/drivers/usb/usbdevice/core/core.c
index c79820642a..2f4a21eee4 100644
--- a/components/drivers/usb/usbdevice/core/core.c
+++ b/components/drivers/usb/usbdevice/core/core.c
@@ -1237,7 +1237,6 @@ rt_err_t rt_usbd_set_altsetting(uintf_t intf, rt_uint8_t value)
/* parameter check */
RT_ASSERT(intf != RT_NULL);
- RT_ASSERT(setting != RT_NULL);
/* find an alternate setting */
setting = rt_usbd_find_altsetting(intf, value);
@@ -1308,6 +1307,12 @@ static void rt_usbd_thread_entry(void* parameter)
rt_kprintf("invalid usb device\n");
break;
case USB_MSG_DATA_NOTIFY:
+ device = rt_usbd_find_device(msg.dcd);
+ if(device == RT_NULL)
+ {
+ rt_kprintf("invalid usb device\n");
+ break;
+ }
ep = rt_usbd_find_endpoint(device, &cls, msg.content.ep_msg.ep_addr);
if(ep != RT_NULL)
ep->handler(device, cls, msg.content.ep_msg.size);