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

Skip to content
Commit 41603e97 authored by Jesper Juhl's avatar Jesper Juhl Committed by Matthew Garrett
Browse files

drivers/platform/x86/amilo-rfkill.c::amilo_rfkill_probe() avoid NULL deref



In drivers/platform/x86/amilo-rfkill.c::amilo_rfkill_probe() the call
to dmi_first_match() may fail and return NULL. If it does return NULL,
then we'll be dereferencing a NULL pointer in the rfkill_alloc() call
where we do 'system_id->driver_data' --> KABOOM!

Avoid that problem by testing for a NULL return value from
dmi_first_match() and bailing out if it fails.

I was a bit uncertain about what to return in the failure case. In the
end I settled for -ENXIO as the most logical error to return.

Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
parent a979e2e2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment