power: fix crash on error for intel_pstate
authorAnatoly Burakov <anatoly.burakov@intel.com>
Fri, 9 Jul 2021 15:55:59 +0000 (15:55 +0000)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 20 Jul 2021 15:24:00 +0000 (17:24 +0200)
commit87fb60835641d790bb57b17043c565317395c119
tree85ebca15a61ff270ac6b7c150216ed8bf070c16b
parenta03e4b62a79b3857d8097d8e95a44e7a0ae3f4f5
power: fix crash on error for intel_pstate

Currently, the error paths can lead to attempts at dereferencing NULL
pointers. Add the check to avoid attempts at dereferencing NULL
pointers.

Coverity issue: 371895
Coverity issue: 371889
Fixes: 06cffd468fdd ("power: refactor ACPI and intel_pstate support")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
lib/power/power_pstate_cpufreq.c