public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] USB: FIX bitfield istl_flip:1, make it unsigned.
@ 2009-11-18 13:12 Roel Kluin
  2009-11-18 15:15 ` Mike Frysinger
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-11-18 13:12 UTC (permalink / raw)
  To: Mike Frysinger, gregkh, linux-usb, Andrew Morton, LKML

istl_flip is a signed bitfield of one bit so it can be -1 or 0.
However in drivers/usb/host/isp1362-hcd.c:1103:

finish_iso_transfers(isp1362_hcd,
	&isp1362_hcd->istl_queue[isp1362_hcd->istl_flip]);

So if isp1362_hcd->istl_flip is set, the 2nd argument becomes
&isp1362_hcd->istl_queue[-1], which is invalid.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
FYI:
drivers/usb/host/isp1362.h:543:
struct isp1362_hcd {
...
	struct isp1362_ep_queue istl_queue[2];
};

The change of the other bitfield may not be strictly necessary
but is preferred, I thought.

Roel

diff --git a/drivers/usb/host/isp1362.h b/drivers/usb/host/isp1362.h
index 1a253eb..5151516 100644
--- a/drivers/usb/host/isp1362.h
+++ b/drivers/usb/host/isp1362.h
@@ -534,8 +534,8 @@ struct isp1362_hcd {
 
 	/* periodic schedule: isochronous */
 	struct list_head	isoc;
-	int			istl_flip:1;
-	int			irq_active:1;
+	unsigned int		istl_flip:1;
+	unsigned int		irq_active:1;
 
 	/* Schedules for the current frame */
 	struct isp1362_ep_queue atl_queue;

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

end of thread, other threads:[~2009-11-18 15:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-18 13:12 [PATCH] USB: FIX bitfield istl_flip:1, make it unsigned Roel Kluin
2009-11-18 15:15 ` Mike Frysinger

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