diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2011-10-18 09:24:36 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-10-18 13:51:35 -0700 |
commit | 0889551267e7b6b4d27dc9f726f3d0cb0d976105 (patch) | |
tree | 8362482d71e09574db4de0a140984400465659e7 /drivers/usb | |
parent | 273d23574f9dacd9c63c80e7d63639a669aad441 (diff) | |
download | linux-0889551267e7b6b4d27dc9f726f3d0cb0d976105.tar.gz |
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: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/f_midi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/f_midi.c b/drivers/usb/gadget/f_midi.c index 44858dc074d3..ef1bc7a174ef 100644 --- a/drivers/usb/gadget/f_midi.c +++ b/drivers/usb/gadget/f_midi.c @@ -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__); |