Author: stefanct Date: Tue Jul 30 11:34:44 2013 New Revision: 1705 URL: http://flashrom.org/trac/flashrom/changeset/1705
Log: dediprog: Fix crash if usb_open() fails.
Signed-off-by: David Woodhouse David.Woodhouse@intel.com Acked-by: Stefan Tauner stefan.tauner@student.tuwien.ac.at
Modified: trunk/dediprog.c
Modified: trunk/dediprog.c ============================================================================== --- trunk/dediprog.c Fri Jul 26 00:58:56 2013 (r1704) +++ trunk/dediprog.c Tue Jul 30 11:34:44 2013 (r1705) @@ -884,6 +884,10 @@ 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",