Skip to content

Commit

Permalink
ALSA: ctxfi - Check the presence of SRC instance in PCM pointer callb…
Browse files Browse the repository at this point in the history
…acks

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: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Jun 9, 2009
1 parent c399f3b commit 5242bc7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sound/pci/ctxfi/ctatc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 5242bc7

Please sign in to comment.