Unverified Commit a437601a authored by Baojun Xu's avatar Baojun Xu Committed by Mark Brown
Browse files

ASoC: tas2781: Add null check for calibration data



For avoid null pointer problem if no calibration data exist.

Fixes: 55137f5a ("ASoC: tas2781: Put three different calibrated data solution into the same data structure")

Signed-off-by: default avatarBaojun Xu <baojun.xu@ti.com>
Link: https://patch.msgid.link/20260319090747.2090-1-baojun.xu@ti.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5e4ed032
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);