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

Commit 9cf05e43 authored by Akhil Karuturi's avatar Akhil Karuturi
Browse files

Asoc: fix integer overflow for long duration offload playback



update total bytes transffered and received to prevent
overflow when playback goes beyond 24 hours.

Change-Id: Icacae7495d2016788ff0bb3796c5a0724b3f5a29
Signed-off-by: default avatarAkhil Karuturi <akarutur@codeaurora.org>
parent 2e4a1a63
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -3092,9 +3092,9 @@ static int msm_compr_pointer(struct snd_compr_stream *cstream,
		pr_err_ratelimited("%s Got RESET EVENTS notification, return error\n",
		pr_err_ratelimited("%s Got RESET EVENTS notification, return error\n",
				   __func__);
				   __func__);
		if (cstream->direction == SND_COMPRESS_PLAYBACK)
		if (cstream->direction == SND_COMPRESS_PLAYBACK)
			runtime->total_bytes_transferred = tstamp.copied_total;
			runtime->total_bytes_transferred = prtd->copied_total;
		else
		else
			runtime->total_bytes_available = tstamp.copied_total;
			runtime->total_bytes_available = prtd->received_total;
		tstamp.pcm_io_frames = 0;
		tstamp.pcm_io_frames = 0;
		memcpy(arg, &tstamp, sizeof(struct snd_compr_tstamp));
		memcpy(arg, &tstamp, sizeof(struct snd_compr_tstamp));
		spin_unlock_irqrestore(&prtd->lock, flags);
		spin_unlock_irqrestore(&prtd->lock, flags);