From: Ravi Babu <ravibabu@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] usb: dwc3: fixes crash in dwc3 driver due to types size mismatch
Date: Thu, 21 Jul 2016 16:11:06 +0530 [thread overview]
Message-ID: <1469097666-2758-1-git-send-email-ravibabu@ti.com> (raw)
The crash at dwc3 driver observed due to offset misalignment
of structure members across files causing wrong code generation
and leads to crash, the issue is found during dfu test.
For instance, ther is is mismatch in code generation to
access the address of structure member dwc->dep[0] in
gadget.c and ep0.c. This leads to NULL pointer reference
casuing the crash. The inclusion of common.h fixes the issue.
The crash occurs due to below commit[1], revert of this patch
resolves the issue.
>>[1] commit 95ebc253e6d4a3370e3dab14743bfc99fcd9cf1b
>>Author: Masahiro Yamada <yamada.masahiro@socionext.com>
>>Date: Tue Jun 28 10:48:40 2016 +0900
types.h: move and redefine resource_size_t
Currently, this is only defined in arch/arm/include/asm/types.h,
so move it to include/linux/types.h to make it available for all
architectures.
I defined it with phys_addr_t as Linux does. I needed to surround
the define with #ifdef __KERNEL__ ... #endif to avoid build errors
in tools building. (Host tools should not include <linux/types.h>
in the first place, but this is already messy in U-Boot...)
>>Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>>Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ravi Babu <ravibabu@ti.com>
---
drivers/usb/dwc3/ep0.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index 12b133f..f49a06e 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -14,6 +14,7 @@
* SPDX-License-Identifier: GPL-2.0
*/
+#include <common.h>
#include <linux/kernel.h>
#include <linux/list.h>
--
1.7.9.5
next reply other threads:[~2016-07-21 10:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-21 10:41 Ravi Babu [this message]
2016-07-21 11:42 ` [U-Boot] [PATCH] usb: dwc3: fixes crash in dwc3 driver due to types size mismatch Marek Vasut
2016-07-21 12:29 ` B, Ravi
2016-07-21 12:35 ` Marek Vasut
2016-07-21 12:44 ` B, Ravi
2016-07-21 12:54 ` Marek Vasut
2016-07-21 13:03 ` B, Ravi
2016-07-21 13:05 ` Marek Vasut
2016-07-22 5:10 ` Masahiro Yamada
2016-07-22 8:06 ` B, Ravi
2016-07-22 10:19 ` Marek Vasut
2016-07-22 11:55 ` Tom Rini
2016-07-26 12:59 ` B, Ravi
2016-07-26 13:04 ` Tom Rini
2016-07-26 13:16 ` B, Ravi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1469097666-2758-1-git-send-email-ravibabu@ti.com \
--to=ravibabu@ti.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox