rawmidi_hw: add sanity check for the invalid stream arguments (coverity)

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2019-05-24 20:45:26 +02:00
parent 8ab0393b42
commit 6efa23f283

View file

@ -186,6 +186,8 @@ int snd_rawmidi_hw_open(snd_rawmidi_t **inputp, snd_rawmidi_t **outputp,
*inputp = NULL;
if (outputp)
*outputp = NULL;
if (!inputp && !outputp)
return -EINVAL;
if ((ret = snd_ctl_hw_open(&ctl, NULL, card, 0)) < 0)
return ret;