public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Correct drv_usb_kbd_init function
@ 2008-08-20 17:00 Ryan CHEN
  2008-09-09 14:35 ` Markus Klotzbücher
  2008-09-09 15:03 ` Wolfgang Denk
  0 siblings, 2 replies; 4+ messages in thread
From: Ryan CHEN @ 2008-08-20 17:00 UTC (permalink / raw)
  To: u-boot

The patch is that check if usb_get_dev_index() function return valid pointer.
If valid, continue. Otherwise return -1.

Signed-off-by: Ryan Chen <ryan.chen@st.com>

---
 common/usb_kbd.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index c876495..880e616 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -164,6 +164,8 @@ int drv_usb_kbd_init(void)
 	/* scan all USB Devices */
 	for(i=0;i<USB_MAX_DEVICE;i++) {
 		dev=usb_get_dev_index(i); /* get device */
+		if(dev == NULL)
+			return -1;
 		if(dev->devnum!=-1) {
 			if(usb_kbd_probe(dev,0)==1) { /* Ok, we found a keyboard */
 				/* check, if it is already registered */
-- 
1.6.0.rc1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] Correct drv_usb_kbd_init function
  2008-08-20 17:00 [U-Boot] [PATCH] Correct drv_usb_kbd_init function Ryan CHEN
@ 2008-09-09 14:35 ` Markus Klotzbücher
  2008-09-09 15:03   ` Wolfgang Denk
  2008-09-09 15:03 ` Wolfgang Denk
  1 sibling, 1 reply; 4+ messages in thread
From: Markus Klotzbücher @ 2008-09-09 14:35 UTC (permalink / raw)
  To: u-boot

while we're at it...

On Wed, Aug 20, 2008 at 01:00:17PM -0400, Ryan CHEN wrote:
> The patch is that check if usb_get_dev_index() function return valid pointer.
> If valid, continue. Otherwise return -1.
> 
> Signed-off-by: Ryan Chen <ryan.chen@st.com>

Acked-by: Markus klotzbuecher <mk@denx.de>

Wolfgang, please apply!

Best regards
Markus

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de")

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] Correct drv_usb_kbd_init function
  2008-08-20 17:00 [U-Boot] [PATCH] Correct drv_usb_kbd_init function Ryan CHEN
  2008-09-09 14:35 ` Markus Klotzbücher
@ 2008-09-09 15:03 ` Wolfgang Denk
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2008-09-09 15:03 UTC (permalink / raw)
  To: u-boot

Dear Ryan CHEN,

In message <1219251617-26166-1-git-send-email-ryan.chen@st.com> you wrote:
> The patch is that check if usb_get_dev_index() function return valid pointer.
> If valid, continue. Otherwise return -1.
> 
> Signed-off-by: Ryan Chen <ryan.chen@st.com>
> 
> ---
>  common/usb_kbd.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"An organization dries up if you don't challenge it with growth."
       - Mark Shepherd, former President and CEO of Texas Instruments

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] Correct drv_usb_kbd_init function
  2008-09-09 14:35 ` Markus Klotzbücher
@ 2008-09-09 15:03   ` Wolfgang Denk
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2008-09-09 15:03 UTC (permalink / raw)
  To: u-boot

Dear Markus =?iso-8859-1?Q?Klotzb=FCcher?=,

In message <20080909143531.GB11987@lisa> you wrote:
> while we're at it...
> 
> On Wed, Aug 20, 2008 at 01:00:17PM -0400, Ryan CHEN wrote:
> > The patch is that check if usb_get_dev_index() function return valid pointer.
> > If valid, continue. Otherwise return -1.
> > 
> > Signed-off-by: Ryan Chen <ryan.chen@st.com>
> 
> Acked-by: Markus klotzbuecher <mk@denx.de>
> 
> Wolfgang, please apply!

Done, thanks!

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Der Irrtum wiederholt sich immerfort in der Tat.  Deshalb mu? man das
Wahre unerm?dlich in Worten wiederholen.                     - Goethe

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-09-09 15:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-20 17:00 [U-Boot] [PATCH] Correct drv_usb_kbd_init function Ryan CHEN
2008-09-09 14:35 ` Markus Klotzbücher
2008-09-09 15:03   ` Wolfgang Denk
2008-09-09 15:03 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox