USB: gadget: midi: fix range check in f_midi_out_open()
Dan Carpenter [Tue, 18 Oct 2011 06:24:36 +0000 (09:24 +0300)]
! 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>

drivers/usb/gadget/f_midi.c

index 44858dc..ef1bc7a 100644 (file)
@@ -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__);