summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2011-10-18 08:24:36 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2011-10-18 22:51:35 +0200
commit0889551267e7b6b4d27dc9f726f3d0cb0d976105 (patch)
tree8362482d71e09574db4de0a140984400465659e7
parentQE/FHCI: fixed the CONTROL bug (diff)
downloadlinux-0889551267e7b6b4d27dc9f726f3d0cb0d976105.tar.xz
linux-0889551267e7b6b4d27dc9f726f3d0cb0d976105.zip
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>
-rw-r--r--drivers/usb/gadget/f_midi.c2
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__);