Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add E-mu 0404 USB automatic sample rate #626

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sound/usb/quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,8 @@ static void set_format_emu_quirk(struct snd_usb_substream *subs,
* by playback substream
*/
if (subs->direction == SNDRV_PCM_STREAM_PLAYBACK) {
if (subs->stream->substream[SNDRV_PCM_STREAM_CAPTURE].interface != -1)
if (subs->stream->substream[SNDRV_PCM_STREAM_CAPTURE].interface != -1 &&

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it would be better if you could check the index of the array before access it (save array access)
so you need to check if subs->stream->substream[SNDRV_PCM_STREAM_CAPTURE] is not NULL

subs->stream->substream[SNDRV_PCM_STREAM_CAPTURE].running)
return;
}

Expand Down