From: Hyotaek Shim Date: Fri, 30 Aug 2019 04:51:48 +0000 (+0900) Subject: [UTC][device][Non ACR][Fix usb-host ref/unref TCs] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=085ee297e58b40bd19fad68c19240599b29cded5;p=test%2Ftct%2Fnative%2Fapi.git [UTC][device][Non ACR][Fix usb-host ref/unref TCs] usb-host-native-utc causes heap-use-after-free on TM1 TZ_BUILD_PROJECT=SAN:Tizen:5.5:Unified:ASAN TZ_BUILD_ID=san-tizen-5.5-unified-asan_20190805.2 ================================================================= ==usb-host-native-utc==18542==ERROR: AddressSanitizer: heap-use-after-free on address 0xb03c1b64 at pc 0xb6884ed7 bp 0xbeafadfc sp 0xbeafadf4 READ of size 4 at 0xb03c1b64 thread T0 Change-Id: Ie4d22cff031a173b145d85df07f75c56fb3b5f9c Signed-off-by: Hyotaek Shim --- diff --git a/src/utc/usb-host/utc-usb-host.c b/src/utc/usb-host/utc-usb-host.c index ed3f3fd5c..3fde67918 100755 --- a/src/utc/usb-host/utc-usb-host.c +++ b/src/utc/usb-host/utc-usb-host.c @@ -366,6 +366,9 @@ int utc_usb_host_ref_device_p(void) ret = usb_host_ref_device(dev); assert_eq_supp(ret, USB_HOST_ERROR_NONE); + ret = usb_host_unref_device(dev); + assert_eq_supp(ret, USB_HOST_ERROR_NONE); + return 0; } @@ -397,6 +400,9 @@ int utc_usb_host_unref_device_p(void) { int ret; + ret = usb_host_ref_device(dev); + assert_eq_supp(ret, USB_HOST_ERROR_NONE); + ret = usb_host_unref_device(dev); assert_eq_supp(ret, USB_HOST_ERROR_NONE);