From cc50d9950807280653973a0dd9cd3b22e323bcd5 Mon Sep 17 00:00:00 2001 From: RD Babiera Date: Mon, 17 Apr 2023 22:43:31 +0000 Subject: [PATCH] usb: provide usb reference to DisplayPort shutdown thread Passes usb object reference to thread creation of mDisplayPortShutdownHelper so that it can properly call DisplayPort shutdown method instead of calling on NULL reference. Test: manual test on device Bug: 278395605 Change-Id: Ie4dabb5e3ae9065f57cc0fbf2593fbe399097472 --- usb/usb/Usb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usb/usb/Usb.cpp b/usb/usb/Usb.cpp index 474164ee..04eabd54 100644 --- a/usb/usb/Usb.cpp +++ b/usb/usb/Usb.cpp @@ -1347,7 +1347,7 @@ void Usb::shutdownDisplayPortPoll() { // Shutdown thread, make sure to rewrite hpd because file no longer exists. write(mDisplayPortShutdown, &flag, sizeof(flag)); - if (pthread_create(&mDisplayPortShutdownHelper, NULL, shutdownDisplayPortPollWork, NULL)) { + if (pthread_create(&mDisplayPortShutdownHelper, NULL, shutdownDisplayPortPollWork, this)) { ALOGE("pthread creation failed %d", errno); } writeDisplayPortAttributeOverride("hpd", "0");