diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2013-07-30 09:34:44 +0000 |
---|---|---|
committer | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2013-07-30 09:34:44 +0000 |
commit | d2a7e873f3c4125ce1f40d2a5330105c571658d0 (patch) | |
tree | 4f09a747d0d538628355c3179b616c790b73cdef /dediprog.c | |
parent | 70e145989bb9d5214a2c50b79b23c457d12f04a5 (diff) | |
download | flashrom-d2a7e873f3c4125ce1f40d2a5330105c571658d0.tar.gz flashrom-d2a7e873f3c4125ce1f40d2a5330105c571658d0.tar.bz2 flashrom-d2a7e873f3c4125ce1f40d2a5330105c571658d0.zip |
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>
Diffstat (limited to 'dediprog.c')
-rw-r--r-- | dediprog.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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", |