From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Fri, 24 Jul 2015 22:05:55 +0200 Subject: [U-Boot] [PATCH] usb: ci_udc: fix request allocation when endpoints are disabled In-Reply-To: <1437750861-6489-1-git-send-email-robh@kernel.org> References: <1437750861-6489-1-git-send-email-robh@kernel.org> Message-ID: <201507242205.55554.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Friday, July 24, 2015 at 05:14:21 PM, Rob Herring wrote: > 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 > Cc: Marek Vasut > Cc: Stephen Warren Applied, thanks! Best regards, Marek Vasut