diff options
| author | Baojun Xu <baojun.xu@ti.com> | 2026-03-19 17:07:47 +0800 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-03-19 12:52:55 +0000 |
| commit | a437601a0a1383260222223440a95dd4322eb7fa (patch) | |
| tree | 1e64089e98dc7243a694e5fe9a850304bc6cd808 /sound | |
| parent | 5e4ed0320b964bb99c9e041d50544926dc09e203 (diff) | |
ASoC: tas2781: Add null check for calibration data
For avoid null pointer problem if no calibration data exist.
Fixes: 55137f5a68b5e ("ASoC: tas2781: Put three different calibrated data solution into the same data structure")
Signed-off-by: Baojun Xu <baojun.xu@ti.com>
Link: https://patch.msgid.link/20260319090747.2090-1-baojun.xu@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
| -rw-r--r-- | sound/soc/codecs/tas2781-fmwlib.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/codecs/tas2781-fmwlib.c b/sound/soc/codecs/tas2781-fmwlib.c index 5798d518d94c..a1d86bd309f4 100644 --- a/sound/soc/codecs/tas2781-fmwlib.c +++ b/sound/soc/codecs/tas2781-fmwlib.c @@ -2550,6 +2550,9 @@ static void tasdev_load_calibrated_data(struct tasdevice_priv *priv, int i) int k = i * (cali_data->cali_dat_sz_per_dev + 1); int rc; + if (!data || !cali_data->total_sz) + return; + if (data[k] != i) { dev_err(priv->dev, "%s: no cal-data for dev %d from usr-spc\n", __func__, i); |
