public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch] Overrun in
@ 2006-04-10  9:01 Eric Sesterhenn
  2006-04-10  9:31 ` smurf
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Sesterhenn @ 2006-04-10  9:01 UTC (permalink / raw)
  To: LKML; +Cc: smurf

hi,

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

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>


--- linux-2.6.17-rc1/drivers/usb/serial/option.c.orig	2006-04-10 10:57:13.000000000 +0200
+++ linux-2.6.17-rc1/drivers/usb/serial/option.c	2006-04-10 10:57:46.000000000 +0200
@@ -582,14 +582,14 @@ static void option_setup_urbs(struct usb
 	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);



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Patch] Overrun in
  2006-04-10  9:01 [Patch] Overrun in Eric Sesterhenn
@ 2006-04-10  9:31 ` smurf
  0 siblings, 0 replies; 2+ messages in thread
From: smurf @ 2006-04-10  9:31 UTC (permalink / raw)
  To: Eric Sesterhenn; +Cc: LKML

[-- Attachment #1: Type: text/plain, Size: 291 bytes --]

Hi,

Eric Sesterhenn:
> 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
> 
Ouch. Thanks.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-10  9:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-10  9:01 [Patch] Overrun in Eric Sesterhenn
2006-04-10  9:31 ` smurf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox