All of lore.kernel.org
 help / color / mirror / Atom feed
* USB: Gadget: COMPOSITE: Debug interface number
@ 2011-02-04  9:50 Jassi Brar
  2011-02-04 19:58 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Jassi Brar @ 2011-02-04  9:50 UTC (permalink / raw)
  To: linux-usb-u79uwXL29TY76Z2rM5mHXA
  Cc: david-b-yBeKhBN/0LDR7s880joybQ, gregkh-l3A5Bk7waGM,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz, maulik-l0cyMroinI0,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	kgene.kim-Sze3O3UU22JBDgjK7y7TUQ

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

Hi,

The commit 'avoid access beyond array max length' incorrectly
compares w_index with MAX_CONFIG_INTERFACES. Whereas only
lower 8bits of w_index refer to the interface number.
So, use 'intf' rather than 'w_index' for comparison.

Thanks

[-- Attachment #2: patch --]
[-- Type: application/octet-stream, Size: 1004 bytes --]

From: Jassi Brar <jassi.brar@samsung.com>
Date: Fri, 4 Feb 2011 17:46:06 +0900
Subject: [PATCH] USB: Gadget: COMPOSITE: Debug interface number

The commit 'avoid access beyond array max length' incorrectly
compares w_index with MAX_CONFIG_INTERFACES. Whereas only
lower 8bits of w_index refer to the interface number.
So, use 'intf' rather than 'w_index' for comparison.

Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
---
 drivers/usb/gadget/composite.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 1ba4bef..e30da2c 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -928,7 +928,7 @@ unknown:
 		 */
 		switch (ctrl->bRequestType & USB_RECIP_MASK) {
 		case USB_RECIP_INTERFACE:
-			if (!cdev->config || w_index >= MAX_CONFIG_INTERFACES)
+			if (!cdev->config || intf >= MAX_CONFIG_INTERFACES)
 				break;
 			f = cdev->config->interface[intf];
 			break;
-- 
1.7.1


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

* Re: USB: Gadget: COMPOSITE: Debug interface number
  2011-02-04  9:50 USB: Gadget: COMPOSITE: Debug interface number Jassi Brar
@ 2011-02-04 19:58 ` Greg KH
  2011-02-05  0:39   ` Jassi Brar
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2011-02-04 19:58 UTC (permalink / raw)
  To: Jassi Brar
  Cc: linux-usb, david-b, gregkh, stern, maulik, linux-samsung-soc, kgene.kim

On Fri, Feb 04, 2011 at 06:50:27PM +0900, Jassi Brar wrote:
> Hi,
> 
> The commit 'avoid access beyond array max length' incorrectly
> compares w_index with MAX_CONFIG_INTERFACES. Whereas only
> lower 8bits of w_index refer to the interface number.
> So, use 'intf' rather than 'w_index' for comparison.

Why did you attach the patch in base64 mode?  Please fix your email
client to not do this and send it to me in a format that I can apply it
in.

Try using 'git send-email' instead.

thanks,

greg k-h

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

* Re: USB: Gadget: COMPOSITE: Debug interface number
  2011-02-04 19:58 ` Greg KH
@ 2011-02-05  0:39   ` Jassi Brar
  0 siblings, 0 replies; 3+ messages in thread
From: Jassi Brar @ 2011-02-05  0:39 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-usb, david-b, gregkh, stern, maulik, linux-samsung-soc, kgene.kim

On Sat, Feb 5, 2011 at 4:58 AM, Greg KH <greg@kroah.com> wrote:
> On Fri, Feb 04, 2011 at 06:50:27PM +0900, Jassi Brar wrote:
>> Hi,
>>
>> The commit 'avoid access beyond array max length' incorrectly
>> compares w_index with MAX_CONFIG_INTERFACES. Whereas only
>> lower 8bits of w_index refer to the interface number.
>> So, use 'intf' rather than 'w_index' for comparison.
>
> Why did you attach the patch in base64 mode?  Please fix your email
> client to not do this and send it to me in a format that I can apply it
> in.
>
> Try using 'git send-email' instead.

I always use git send-email, only this time the network connectivity is down
and immediate fix out of sight due to long holiday season here. So, I had
to send it as an attachment.
Will resend next week by git send-email.

Thanks

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

end of thread, other threads:[~2011-02-05  0:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-04  9:50 USB: Gadget: COMPOSITE: Debug interface number Jassi Brar
2011-02-04 19:58 ` Greg KH
2011-02-05  0:39   ` Jassi Brar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.