From: Vladimir Serbinenko Date: Sat, 24 Jan 2015 19:38:12 +0000 (+0100) Subject: uhci: Fix null pointer dereference. X-Git-Tag: 2.02-beta3~541 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ff9d5a54ead6fba080a08fcb1ff8462b8cf2497;p=thirdparty%2Fgrub.git uhci: Fix null pointer dereference. Found by: Coverity scan. --- diff --git a/grub-core/bus/usb/uhci.c b/grub-core/bus/usb/uhci.c index a95fdfe07..7c5811fd6 100644 --- a/grub-core/bus/usb/uhci.c +++ b/grub-core/bus/usb/uhci.c @@ -625,9 +625,7 @@ grub_uhci_check_transfer (grub_usb_controller_t dev, return GRUB_USB_ERR_NONE; } - grub_dprintf ("uhci", "t status=0x%02x\n", errtd->ctrl_status); - - if (!(errtd->ctrl_status & (1 << 23))) + if (errtd && !(errtd->ctrl_status & (1 << 23))) { grub_usb_err_t err = GRUB_USB_ERR_NONE;