Skip to content

Commit dc26808

Browse files
rfvirgilbroonie
authored andcommitted
ASoC: cs-amp-lib: Fix NULL pointer crash if efi.get_variable is NULL
Call efi_rt_services_supported() to check that efi.get_variable exists before calling it. Signed-off-by: Richard Fitzgerald <[email protected]> Fixes: 1cad872 ("ASoC: cs-amp-lib: Add helpers for factory calibration data") Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 93afd02 commit dc26808

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/soc/codecs/cs-amp-lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static efi_status_t cs_amp_get_efi_variable(efi_char16_t *name,
108108

109109
KUNIT_STATIC_STUB_REDIRECT(cs_amp_get_efi_variable, name, guid, size, buf);
110110

111-
if (IS_ENABLED(CONFIG_EFI))
111+
if (efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE))
112112
return efi.get_variable(name, guid, &attr, size, buf);
113113

114114
return EFI_NOT_FOUND;

0 commit comments

Comments
 (0)