Skip to content

Commit

Permalink
USB: gadget: midi: fix range check in f_midi_out_open()
Browse files Browse the repository at this point in the history
! 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>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Oct 18, 2011
1 parent 273d235 commit 0889551
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/gadget/f_midi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__);
Expand Down

0 comments on commit 0889551

Please sign in to comment.