From cf43a6b53bd6bdeb381477b1c323abcc69158c42 Mon Sep 17 00:00:00 2001
From: hathach <thach@tinyusb.org>
Date: Wed, 15 Aug 2018 17:55:16 +0700
Subject: [PATCH] fix memory issue with usbd control xfer

---
 src/device/usbd_pvt.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/device/usbd_pvt.h b/src/device/usbd_pvt.h
index 707e8036f..55d1867d7 100644
--- a/src/device/usbd_pvt.h
+++ b/src/device/usbd_pvt.h
@@ -69,7 +69,7 @@ tusb_error_t usbd_open_edpt_pair(uint8_t rhport, tusb_desc_endpoint_t const* p_d
   do {                                                                        \
     if (_len) {                                                               \
       tusb_error_t err;                                                       \
-      dcd_control_xfer(_rhport, _dir, _usbd_ctrl_buf, _len);                  \
+      dcd_control_xfer(_rhport, _dir, (uint8_t*) _buffer, _len);              \
       osal_semaphore_wait( _usbd_ctrl_sem, OSAL_TIMEOUT_CONTROL_XFER, &err ); \
       STASK_ASSERT_ERR( err );                                                \
     }                                                                         \