mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
Correct drv_usb_kbd_init function
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>
This commit is contained in:
@@ -162,6 +162,8 @@ int drv_usb_kbd_init(void)
|
|||||||
/* scan all USB Devices */
|
/* scan all USB Devices */
|
||||||
for(i=0;i<USB_MAX_DEVICE;i++) {
|
for(i=0;i<USB_MAX_DEVICE;i++) {
|
||||||
dev=usb_get_dev_index(i); /* get device */
|
dev=usb_get_dev_index(i); /* get device */
|
||||||
|
if(dev == NULL)
|
||||||
|
return -1;
|
||||||
if(dev->devnum!=-1) {
|
if(dev->devnum!=-1) {
|
||||||
if(usb_kbd_probe(dev,0)==1) { /* Ok, we found a keyboard */
|
if(usb_kbd_probe(dev,0)==1) { /* Ok, we found a keyboard */
|
||||||
/* check, if it is already registered */
|
/* check, if it is already registered */
|
||||||
|
Reference in New Issue
Block a user