rawmidi: fix the params_mode check condition in snd_rawmidi_tread()

The condition should be obviously reversed.

Reported-by: Mark ZurSchmiede <zursch@gmail.com>
Fixes: 5ac61983 ("rawmidi: allow timestamp reads only for the appropriate read mode")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2022-06-26 16:07:56 +02:00
parent f91c89da99
commit 917f412484

View file

@ -1114,7 +1114,7 @@ ssize_t snd_rawmidi_tread(snd_rawmidi_t *rawmidi, struct timespec *tstamp, void
assert(rawmidi);
assert(rawmidi->stream == SND_RAWMIDI_STREAM_INPUT);
assert(buffer || size == 0);
if ((rawmidi->params_mode & SNDRV_RAWMIDI_MODE_FRAMING_MASK) == SNDRV_RAWMIDI_MODE_FRAMING_TSTAMP)
if ((rawmidi->params_mode & SNDRV_RAWMIDI_MODE_FRAMING_MASK) != SNDRV_RAWMIDI_MODE_FRAMING_TSTAMP)
return -EINVAL;
if (rawmidi->ops->tread == NULL)
return -ENOTSUP;