From 2e8b1e8211070e49024eed93829dc70784072db3 Mon Sep 17 00:00:00 2001 From: Visual Ehrmanntraut <30368284+VisualEhrmanntraut@users.noreply.github.com> Date: Mon, 19 Aug 2024 17:36:26 +0300 Subject: [PATCH] fix(X6000FB): fail if embedded panel link is null --- NootedRed/X6000FB.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/NootedRed/X6000FB.cpp b/NootedRed/X6000FB.cpp index 0f16e93e..8c7ef89f 100644 --- a/NootedRed/X6000FB.cpp +++ b/NootedRed/X6000FB.cpp @@ -314,16 +314,8 @@ IOReturn X6000FB::wrapSetAttributeForConnection(IOService *framebuffer, IOIndex connectIndex, attribute, value); if (attribute != static_cast('bklt')) { return ret; } - if (!callback->maxPwmBacklightLvl) { - DBGLOG("X6000FB", "setAttributeForConnection: May not control backlight at this time; maxPwmBacklightLvl is 0"); - return kIOReturnSuccess; - } - - if (callback->embeddedPanelLink == nullptr) { - DBGLOG("X6000FB", - "setAttributeForConnection: May not control backight at this time; embeddedPanelLink is nullptr"); - return kIOReturnSuccess; - } + if (callback->maxPwmBacklightLvl == 0) { return kIOReturnSuccess; } + if (callback->embeddedPanelLink == nullptr) { return kIOReturnNoDevice; } // Set the backlight callback->curPwmBacklightLvl = static_cast(value);