* [U-Boot] [PATCH] usb: gadget: pxa25x_udc: fix use-before-initialized bug
@ 2015-01-07 18:23 Nable
2015-01-07 23:31 ` Marek Vasut
0 siblings, 1 reply; 6+ messages in thread
From: Nable @ 2015-01-07 18:23 UTC (permalink / raw)
To: u-boot
Fix use-before-initialized bug in pxa25x_udc driver.
Function usb_gadget_register_driver calls udc_disable,
and udc_disable calls pullup_off that uses dev->mach->udc_command.
But dev->mach is initialized in usb_gadget_register_driver after
calling udc_disable. This patch fixes the order of initialization.
Signed-off-by: Nable <Nable.MainInbox@googlemail.com>
---
drivers/usb/gadget/pxa25x_udc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c
index 8945c5b..d4460b2 100644
--- a/drivers/usb/gadget/pxa25x_udc.c
+++ b/drivers/usb/gadget/pxa25x_udc.c
@@ -1950,11 +1950,11 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
dev->watchdog.period = 5000 * CONFIG_SYS_HZ / 1000000; /* 5 ms */
dev->watchdog.function = udc_watchdog;
+ dev->mach = &mach_info;
+
udc_disable(dev);
udc_reinit(dev);
- dev->mach = &mach_info;
-
dev->gadget.name = "pxa2xx_udc";
retval = driver->bind(&dev->gadget);
if (retval) {
--
2.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] usb: gadget: pxa25x_udc: fix use-before-initialized bug
2015-01-07 18:23 [U-Boot] [PATCH] usb: gadget: pxa25x_udc: fix use-before-initialized bug Nable
@ 2015-01-07 23:31 ` Marek Vasut
2015-01-08 8:38 ` Nable
0 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2015-01-07 23:31 UTC (permalink / raw)
To: u-boot
On Wednesday, January 07, 2015 at 07:23:52 PM, Nable wrote:
> Fix use-before-initialized bug in pxa25x_udc driver.
>
> Function usb_gadget_register_driver calls udc_disable,
> and udc_disable calls pullup_off that uses dev->mach->udc_command.
> But dev->mach is initialized in usb_gadget_register_driver after
> calling udc_disable. This patch fixes the order of initialization.
>
> Signed-off-by: Nable <Nable.MainInbox@googlemail.com>
Hi!
Can you please fix From: and Signed-off-by: fields so that they reflect a real
person (you) ? Otherwise I'm happy you sent the fix and I'll pick the fixed
version.
Thanks!
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] usb: gadget: pxa25x_udc: fix use-before-initialized bug
2015-01-07 23:31 ` Marek Vasut
@ 2015-01-08 8:38 ` Nable
2015-01-08 17:05 ` Marek Vasut
0 siblings, 1 reply; 6+ messages in thread
From: Nable @ 2015-01-08 8:38 UTC (permalink / raw)
To: u-boot
Hi!
> Can you please fix From: and Signed-off-by: fields
Oh, it looks like I have to accept this requirement. Ok, I'll fix it.
Should I also change tag in subject to '[PATCH v2]' in a fixed patch?
Thank you for kind answer!
Best regards,
Alex Sadovsky.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] usb: gadget: pxa25x_udc: fix use-before-initialized bug
2015-01-08 8:38 ` Nable
@ 2015-01-08 17:05 ` Marek Vasut
2015-01-08 18:19 ` Nable
0 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2015-01-08 17:05 UTC (permalink / raw)
To: u-boot
On Thursday, January 08, 2015 at 09:38:45 AM, Nable wrote:
> Hi!
Hi!
> > Can you please fix From: and Signed-off-by: fields
>
> Oh, it looks like I have to accept this requirement. Ok, I'll fix it.
> Should I also change tag in subject to '[PATCH v2]' in a fixed patch?
>
> Thank you for kind answer!
You can use [PATCH RESEND], which is probably much clearer in expressing
the intent. You might add a short note just before the diffstat saying that
you only updated the SoB line and author to match the real deal, but didn't
change the patch contents.
You can read [1] for the finer points of patch submission process, but TL;DR
it's pretty much the same as Linux ;-)
[1] http://www.denx.de/wiki/U-Boot/Patches#General_Patch_Submission_Rules
Thank you!
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] usb: gadget: pxa25x_udc: fix use-before-initialized bug
2015-01-08 17:05 ` Marek Vasut
@ 2015-01-08 18:19 ` Nable
2015-01-09 0:49 ` Marek Vasut
0 siblings, 1 reply; 6+ messages in thread
From: Nable @ 2015-01-08 18:19 UTC (permalink / raw)
To: u-boot
> You can use [PATCH RESEND], which is probably much clearer in expressing
> the intent. You might add a short note just before the diffstat saying that
> you only updated the SoB line and author to match the real deal, but didn't
> change the patch contents.
I've edited my patch and it's still applies on to top HEAD of master branch,
so I've sent fixed version to mailing list. Thank you for mentioning this
idea of commentaries before diffstat output, I've never heard about it.
> You can read [1] for the finer points of patch submission process, but
> TL;DR
> it's pretty much the same as Linux ;-)
Sounds like a nice joke! In fact, I'm doing my first steps in open-source
software, so sending patches to Linux is something like a far dream.
But if I reach that stage someday, then I'll be able to say that it's
"pretty much the same as for U-Boot".
> [1] http://www.denx.de/wiki/U-Boot/Patches#General_Patch_Submission_Rules
I've studied [1] yesterday, and looked through it again today,
so I hope that I'm doing everything in a right way this time.
Best regards,
Alex.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] usb: gadget: pxa25x_udc: fix use-before-initialized bug
2015-01-08 18:19 ` Nable
@ 2015-01-09 0:49 ` Marek Vasut
0 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2015-01-09 0:49 UTC (permalink / raw)
To: u-boot
On Thursday, January 08, 2015 at 07:19:35 PM, Nable wrote:
Hi!
> > You can use [PATCH RESEND], which is probably much clearer in expressing
> > the intent. You might add a short note just before the diffstat saying
> > that you only updated the SoB line and author to match the real deal,
> > but didn't change the patch contents.
>
> I've edited my patch and it's still applies on to top HEAD of master
> branch, so I've sent fixed version to mailing list.
Thanks!
> Thank you for
> mentioning this idea of commentaries before diffstat output, I've never
> heard about it.
It's mostly useful to save reviewers the time figuring out what changed in
the patch and such message never propagates into the applied patch in the
tree :)
> > You can read [1] for the finer points of patch submission process, but
> > TL;DR
> > it's pretty much the same as Linux ;-)
>
> Sounds like a nice joke! In fact, I'm doing my first steps in open-source
> software, so sending patches to Linux is something like a far dream.
> But if I reach that stage someday, then I'll be able to say that it's
> "pretty much the same as for U-Boot".
Heh, everyone's been there at some point. Good luck and have fun :)
> > [1] http://www.denx.de/wiki/U-Boot/Patches#General_Patch_Submission_Rules
>
> I've studied [1] yesterday, and looked through it again today,
> so I hope that I'm doing everything in a right way this time.
Yeah, no worries. You'll quickly get the hang of it and someone will remind you
in case you screw up bigtime anyway ;-)
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-01-09 0:49 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-07 18:23 [U-Boot] [PATCH] usb: gadget: pxa25x_udc: fix use-before-initialized bug Nable
2015-01-07 23:31 ` Marek Vasut
2015-01-08 8:38 ` Nable
2015-01-08 17:05 ` Marek Vasut
2015-01-08 18:19 ` Nable
2015-01-09 0:49 ` Marek Vasut
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox