mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-15 01:24:33 +00:00
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>
This commit is contained in:
parent
273d23574f
commit
0889551267
@ -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__);
|
||||
|
Loading…
x
Reference in New Issue
Block a user