From 5d67ddda4e4c0916830e8bda03cad5dc795724b3 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 16 Jul 2017 07:00:48 -0600 Subject: [PATCH] USBMSC: Add missing logic to saved device description. --- drivers/usbdev/usbmsc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/usbdev/usbmsc.c b/drivers/usbdev/usbmsc.c index 475fd57d32..3001e2579b 100644 --- a/drivers/usbdev/usbmsc.c +++ b/drivers/usbdev/usbmsc.c @@ -1719,13 +1719,18 @@ errout_with_lock: ****************************************************************************/ #ifdef CONFIG_USBMSC_COMPOSITE -int usbmsc_classobject(FAR void *handle, FAR struct usbdev_description_s *devdesc, +int usbmsc_classobject(FAR void *handle, + FAR struct usbdev_description_s *devdesc, FAR struct usbdevclass_driver_s **classdev) { FAR struct usbmsc_alloc_s *alloc = (FAR struct usbmsc_alloc_s *)handle; int ret; - DEBUGASSERT(handle && classdev); + DEBUGASSERT(handle != NULL && classdev != NULL); + + /* Save the device description */ + + memcpy(&alloc->dev.devdesc, devdesc, sizeof(struct usbdev_description_s)); /* Export the LUNs as with the "standalone" USB mass storage driver, but * don't register the class instance with the USB device infrastructure.