Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit e63a5921 authored by Dominik Laskowski's avatar Dominik Laskowski
Browse files

SF: Do not deref empty std::optional<PowerMode>

In I3a2eae4efc4a5c6113700a9ca9e9b261e364a878, a display's power mode is
std::nullopt (unknown) until the first setPowerMode. The condition to
power on the display from that state relies on undefined behavior, as
it dereferences std::nullopt. It only works because PowerMode::OFF is
0 and the memory happens to be zeroed.

Bug: 250421145
Test: Boot
Change-Id: I0db8970b37da6eb308043157cd2ac7a9f6764294
Merged-In: I0db8970b37da6eb308043157cd2ac7a9f6764294
parent 383832ff
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment