Re: Kernel panic with usbtest t5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 17 Jun 2010, Gupta, Ajay Kumar wrote:

> Hi,
> 
> I am getting below kernel panic (A) while running USBTEST t-5 on OMAP3EVM.
> 
> I found below two recent patches on usb sg list.
> 1. USB: Change the scatterlist type in struct urb [910f8d0]
> 2. USB: simplify usb_sg_init()                           [0ba169a]
> 
> If I revert the patch -1 alone then I get another kernel panic-B
> 
> Reverting both the above patches doesn't cause any panic.

I believe I see the cause.  Careless reuse of local variables in an 
inner loop.  Does this patch fix the problem?

Alan Stern



Index: usb-2.6/drivers/usb/core/message.c
===================================================================
--- usb-2.6.orig/drivers/usb/core/message.c
+++ usb-2.6/drivers/usb/core/message.c
@@ -416,8 +416,11 @@ int usb_sg_init(struct usb_sg_request *i
 			/* A length of zero means transfer the whole sg list */
 			len = length;
 			if (len == 0) {
-				for_each_sg(sg, sg, nents, i)
-					len += sg->length;
+				struct scatterlist	*sg2;
+				int			j;
+
+				for_each_sg(sg, sg2, nents, j)
+					len += sg2->length;
 			}
 		} else {
 			/*

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux