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

Commit 5242bc76 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: ctxfi - Check the presence of SRC instance in PCM pointer callbacks



The SRC instances may not exist when PCM pointer callback is called at
the state before initialization is finished.  Add the NULL check just
to be sure.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent c399f3be
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -445,6 +445,8 @@ atc_pcm_playback_position(struct ct_atc *atc, struct ct_atc_pcm *apcm)
	u32 size, max_cisz;
	int position;

	if (!src)
		return 0;
	position = src->ops->get_ca(src);

	size = apcm->vm_block->size;
@@ -782,6 +784,8 @@ atc_pcm_capture_position(struct ct_atc *atc, struct ct_atc_pcm *apcm)
{
	struct src *src = apcm->src;

	if (!src)
		return 0;
	return src->ops->get_ca(src) - apcm->vm_block->addr;
}