]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
usb: ci_udc: fix request allocation when endpoints are disabled
authorRob Herring <robh@kernel.org>
Fri, 24 Jul 2015 15:14:21 +0000 (10:14 -0500)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 9 Sep 2015 11:49:05 +0000 (13:49 +0200)
commitc7fb8c5b01a5dc0c49cf4410fd133658676f52bd
tree7198359a6cae7a2adf8743a8957b1f3adfc745fd
parent2751b634989f30620209d841047131e42742c9d2
usb: ci_udc: fix request allocation when endpoints are disabled

The ci_udc driver request allocation assumes that the endpoint descriptor
pointer is set to retrieve the endpoint number, but that is only true
when the endpoint is enabled. This results in a NULL ptr dereference
which for me happens to return 0 value. This causes the EP0 request
struct to be returned for other endpoints. Some gadget drivers like
fastboot and USB MS work fine, but ethernet does not.

Really, the ci_udc driver is the oddball here doing this EP0 special
case handling Stephen added. All the other drivers alloc/free functions
are pretty much the same with the only variation being the size of the
private struct. This could all be consolidated to a common function.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Marek Vasut <marex@denx.de>
Acked-by: Stephen Warren <swarren@nvidia.com>
drivers/usb/gadget/ci_udc.c