mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-01 22:21:16 +02:00
dediprog: Fix crash if usb_open() fails
Corresponding to flashrom svn r1705. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
This commit is contained in:

committed by
Stefan Tauner

parent
70e145989b
commit
d2a7e873f3
@ -884,6 +884,10 @@ int dediprog_init(void)
|
||||
msg_pdbg("Found USB device (%04x:%04x).\n",
|
||||
dev->descriptor.idVendor, dev->descriptor.idProduct);
|
||||
dediprog_handle = usb_open(dev);
|
||||
if (!dediprog_handle) {
|
||||
msg_perr("Could not open USB device: %s\n", usb_strerror());
|
||||
return 1;
|
||||
}
|
||||
ret = usb_set_configuration(dediprog_handle, 1);
|
||||
if (ret < 0) {
|
||||
msg_perr("Could not set USB device configuration: %i %s\n",
|
||||
|
Reference in New Issue
Block a user