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>
num_freqs, pi->lcore_id);
out:
- fclose(f_min);
- fclose(f_max);
+ if (f_min != NULL)
+ fclose(f_min);
+ if (f_max != NULL)
+ fclose(f_max);
return ret;
}