Commit 08895512 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

USB: gadget: midi: fix range check in f_midi_out_open()

! has higher precedence than >= and since neither 0 nor 1 are greater
than 8 the condition is always false.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarDaniel Mack <zonque@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 273d2357
......@@ -644,7 +644,7 @@ static int f_midi_out_open(struct snd_rawmidi_substream *substream)
{
struct f_midi *midi = substream->rmidi->private_data;
if (!substream->number >= MAX_PORTS)
if (substream->number >= MAX_PORTS)
return -EINVAL;
VDBG(midi, "%s()\n", __func__);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment