Skip incorrect USB devices.
* grub-core/bus/usb/usb.c (grub_usb_device_initialize): Fail if configcnt == 0. * include/grub/usb.h (grub_usb_err_t): New enum value GRUB_USB_ERR_BADDEVICE.
This commit is contained in:
parent
638dbe4f27
commit
ff44d107ad
3 changed files with 17 additions and 1 deletions
|
@ -1,3 +1,12 @@
|
|||
2011-05-16 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Skip incorrect USB devices.
|
||||
|
||||
* grub-core/bus/usb/usb.c (grub_usb_device_initialize): Fail if
|
||||
configcnt == 0.
|
||||
* include/grub/usb.h (grub_usb_err_t): New enum value
|
||||
GRUB_USB_ERR_BADDEVICE.
|
||||
|
||||
2011-05-16 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Fuloong video init support.
|
||||
|
|
|
@ -185,6 +185,12 @@ grub_usb_device_initialize (grub_usb_device_t dev)
|
|||
for (i = 0; i < 8; i++)
|
||||
dev->config[i].descconf = NULL;
|
||||
|
||||
if (descdev->configcnt == 0)
|
||||
{
|
||||
err = GRUB_USB_ERR_BADDEVICE;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
for (i = 0; i < descdev->configcnt; i++)
|
||||
{
|
||||
int pos;
|
||||
|
|
|
@ -38,7 +38,8 @@ typedef enum
|
|||
GRUB_USB_ERR_BABBLE,
|
||||
GRUB_USB_ERR_TIMEOUT,
|
||||
GRUB_USB_ERR_BITSTUFF,
|
||||
GRUB_USB_ERR_UNRECOVERABLE
|
||||
GRUB_USB_ERR_UNRECOVERABLE,
|
||||
GRUB_USB_ERR_BADDEVICE
|
||||
} grub_usb_err_t;
|
||||
|
||||
typedef enum
|
||||
|
|
Loading…
Reference in a new issue