[flashrom] [PATCH] Fix dediprog crash if usb_open() fails

David Woodhouse dwmw2 at infradead.org
Mon Jul 29 15:40:14 CEST 2013


Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>

---
Ick. You made me touch Subversion, even if only through 'git svn clone'.

diff --git a/dediprog.c b/dediprog.c
index fb95d10..2640808 100644
--- a/dediprog.c
+++ b/dediprog.c
@@ -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",

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse at intel.com                              Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5745 bytes
Desc: not available
URL: <http://www.flashrom.org/pipermail/flashrom/attachments/20130729/93b1c495/attachment.bin>


More information about the flashrom mailing list