From: Gurchetan Singh Date: Tue, 18 Mar 2025 23:01:47 +0000 (-0700) Subject: [PATCH] gfxstream: check device exists before using it X-Git-Tag: archive/raspbian/25.0.7-2+rpi1^2^2^2^2^2~3 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4ac91ff1fac0d240b04196d4e609f1242c8af5ee;p=mesa.git [PATCH] gfxstream: check device exists before using it Segfaults in the error case otherwise. Cc: mesa-stable Reviewed-by: Aaron Ruby Gbp-Pq: Name gfxstream-check-device-before-using.diff --- diff --git a/src/gfxstream/guest/connection-manager/GfxStreamConnectionManager.cpp b/src/gfxstream/guest/connection-manager/GfxStreamConnectionManager.cpp index 31a950522..8139853e9 100644 --- a/src/gfxstream/guest/connection-manager/GfxStreamConnectionManager.cpp +++ b/src/gfxstream/guest/connection-manager/GfxStreamConnectionManager.cpp @@ -70,6 +70,11 @@ bool GfxStreamConnectionManager::initialize() { // Use kCapsetGfxStreamVulkan for now, Ranchu HWC needs to be modified to pass in // right capset. auto device = VirtGpuDevice::getInstance(kCapsetGfxStreamVulkan); + if (!device) { + mesa_logd("Failed to get VirtGpuDevice\n"); + return false; + } + mDescriptor = device->getDeviceHandle(); mStream = createVirtioGpuAddressSpaceStream(kCapsetGfxStreamVulkan); if (!mStream) {