diff options
author | Eric Sesterhenn <snakebyte@gmx.de> | 2006-04-23 22:52:28 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-05-01 12:03:42 -0700 |
commit | 5e8273250e73d3e2c4e67d0480dcb54e972f5023 (patch) | |
tree | e7b33aa51926c8a4f0ace7098dcb9e8c003ff38e | |
parent | c89ce82c2d942daacc7d7f5d3efafe7dba70bd23 (diff) | |
download | kernel-common-5e8273250e73d3e2c4e67d0480dcb54e972f5023.tar.gz kernel-common-5e8273250e73d3e2c4e67d0480dcb54e972f5023.tar.bz2 kernel-common-5e8273250e73d3e2c4e67d0480dcb54e972f5023.zip |
[PATCH] USB: fix array overrun in drivers/usb/serial/option.c
since the arrays are declared as in_urbs[N_IN_URB]
and out_urbs[N_OUT_URB] both for loops, go one
over the end of the array. This fixes coverity id #555
This patch was already included in Linus' tree.
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/usb/serial/option.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 52bdf6fe46f2..fd8a50e081d1 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -582,14 +582,14 @@ static void option_setup_urbs(struct usb_serial *serial) portdata = usb_get_serial_port_data(port); /* Do indat endpoints first */ - for (j = 0; j <= N_IN_URB; ++j) { + for (j = 0; j < N_IN_URB; ++j) { portdata->in_urbs[j] = option_setup_urb (serial, port->bulk_in_endpointAddress, USB_DIR_IN, port, portdata->in_buffer[j], IN_BUFLEN, option_indat_callback); } /* outdat endpoints */ - for (j = 0; j <= N_OUT_URB; ++j) { + for (j = 0; j < N_OUT_URB; ++j) { portdata->out_urbs[j] = option_setup_urb (serial, port->bulk_out_endpointAddress, USB_DIR_OUT, port, portdata->out_buffer[j], OUT_BUFLEN, option_outdat_callback); |