Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c975e39c authored by Dan Carpenter's avatar Dan Carpenter Committed by Mark Brown
Browse files

ASoC: rt5663: fix a debug statement



We increment "i" before printing the debug statement.  That makes it
the wrong sleep_time[] information and Smatch complains that the last
increment could be beyond the end of the array.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarBard Liao <bardliao@realtek.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 513e43ef
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1547,11 +1547,11 @@ static int rt5663_jack_detect(struct snd_soc_codec *codec, int jack_insert)
			msleep(sleep_time[i]);
			val = snd_soc_read(codec, RT5663_EM_JACK_TYPE_2) &
				0x0003;
			dev_dbg(codec->dev, "%s: MX-00e7 val=%x sleep %d\n",
				__func__, val, sleep_time[i]);
			i++;
			if (val == 0x1 || val == 0x2 || val == 0x3)
				break;
			dev_dbg(codec->dev, "%s: MX-00e7 val=%x sleep %d\n",
				__func__, val, sleep_time[i]);
		}
		dev_dbg(codec->dev, "%s val = %d\n", __func__, val);
		switch (val) {