From d196a75a41ab5c5bcde45f9e4c17bd354ac0be56 Mon Sep 17 00:00:00 2001 From: Grissiom Date: Sat, 4 May 2013 18:34:13 +0800 Subject: [PATCH 1/3] usbdevice/core/core.c: fix garbage value bug This could crash the program with -O1 and -O2 in MDK. --- components/drivers/usb/usbdevice/core/core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); From 692f984a2369682250a42ece2d96d79cc1f20bf6 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Sun, 5 May 2013 05:41:37 +0800 Subject: [PATCH 2/3] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 754f6995e7..8c58a9efd7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -RT-Thread -========= +# RT-Thread # [![Build Status](https://travis-ci.org/RT-Thread/rt-thread.png)](https://travis-ci.org/RT-Thread/rt-thread) RT-Thread is an open source real-time operating system for embedded devices. + From ab3e00cc21710aef4369c04e8a3ac7882d5a0c28 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Sun, 5 May 2013 05:45:41 +0800 Subject: [PATCH 3/3] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 0927f434b5..7b18fcd107 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ notifications: before_script: # travis has changed to 64-bit and we require 32-bit compatibility libraries + - sudo apt-get update - "sudo apt-get -qq install libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386 || true" - "[ $RTT_TOOL_CHAIN = 'sourcery-arm' ] && curl -s https://sourcery.mentor.com/public/gnu_toolchain/arm-none-eabi/arm-2012.09-63-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 | sudo tar xjf - -C /opt && export RTT_EXEC_PATH=/opt/arm-2012.09/bin && /opt/arm-2012.09/bin/arm-none-eabi-gcc --version || true" - "[ $RTT_TOOL_CHAIN = 'sourcery-mips' ] && curl -s https://sourcery.mentor.com/public/gnu_toolchain/mips-sde-elf/mips-2012.09-98-mips-sde-elf-i686-pc-linux-gnu.tar.bz2 | sudo tar xjf - -C /opt && export RTT_EXEC_PATH=/opt/mips-2012.09/bin && /opt/mips-2012.09/bin/mips-sde-elf-gcc --version || true"