Skip to content

Commit

Permalink
fix(X6000FB): fail if embedded panel link is null
Browse files Browse the repository at this point in the history
  • Loading branch information
VisualEhrmanntraut committed Aug 19, 2024
1 parent 9e84f14 commit 2e8b1e8
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions NootedRed/X6000FB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,16 +314,8 @@ IOReturn X6000FB::wrapSetAttributeForConnection(IOService *framebuffer, IOIndex
connectIndex, attribute, value);
if (attribute != static_cast<UInt32>('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<UInt32>(value);
Expand Down

0 comments on commit 2e8b1e8

Please sign in to comment.