Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <rf@opensource.cirrus.com>
Fixes: 1cad8725f2b9 ("ASoC: cs-amp-lib: Add helpers for factory calibration data")
Link: https://patch.msgid.link/20240805114222.15722-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Richard Fitzgerald and committed by
Mark Brown
dc268085 93afd028

+1 -1
+1 -1
sound/soc/codecs/cs-amp-lib.c
··· 108 108 109 109 KUNIT_STATIC_STUB_REDIRECT(cs_amp_get_efi_variable, name, guid, size, buf); 110 110 111 - if (IS_ENABLED(CONFIG_EFI)) 111 + if (efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE)) 112 112 return efi.get_variable(name, guid, &attr, size, buf); 113 113 114 114 return EFI_NOT_FOUND;