[PATCH 04/16] ALSA: hda/tas2781: handle missing calibration data

From: Gergo Koteles
Date: Wed Dec 06 2023 - 19:00:21 EST


Also check the return value of the first get_variable call.

Signed-off-by: Gergo Koteles <soyer@xxxxxx>
---
sound/pci/hda/tas2781_hda_i2c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c
index d272d3d08b29..7c286802b273 100644
--- a/sound/pci/hda/tas2781_hda_i2c.c
+++ b/sound/pci/hda/tas2781_hda_i2c.c
@@ -455,9 +455,9 @@ static int tas2781_save_calibration(struct tasdevice_priv *tas_priv)
status = efi.get_variable(efi_name, &efi_guid, &attr,
&tas_priv->cali_data.total_sz,
tas_priv->cali_data.data);
- if (status != EFI_SUCCESS)
- return -EINVAL;
}
+ if (status != EFI_SUCCESS)
+ return -EINVAL;

tmp_val = (unsigned int *)tas_priv->cali_data.data;

--
2.43.0