Skip to content

Commit a437601

Browse files
jimxbj-dotbroonie
authored andcommitted
ASoC: tas2781: Add null check for calibration data
For avoid null pointer problem if no calibration data exist. Fixes: 55137f5 ("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>
1 parent 5e4ed03 commit a437601

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

sound/soc/codecs/tas2781-fmwlib.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2550,6 +2550,9 @@ static void tasdev_load_calibrated_data(struct tasdevice_priv *priv, int i)
25502550
int k = i * (cali_data->cali_dat_sz_per_dev + 1);
25512551
int rc;
25522552

2553+
if (!data || !cali_data->total_sz)
2554+
return;
2555+
25532556
if (data[k] != i) {
25542557
dev_err(priv->dev, "%s: no cal-data for dev %d from usr-spc\n",
25552558
__func__, i);

0 commit comments

Comments
 (0)