Blame SOURCES/0001-Fix-crash-on-early-fail.patch

c596b8
From 73001792b29f080fcabc57f30d6030bedb2a24b0 Mon Sep 17 00:00:00 2001
c596b8
From: Lubomir Rintel <lkundrak@v3.sk>
c596b8
Date: Wed, 20 Jul 2016 21:14:10 +0200
c596b8
Subject: [PATCH] Fix crash on early fail
c596b8
c596b8
Don't uninitialize libusb if it has not been initialized yet.
c596b8
c596b8
https://bugzilla.redhat.com/show_bug.cgi?id=1358472
c596b8
---
c596b8
 usb_modeswitch.c | 3 ++-
c596b8
 1 file changed, 2 insertions(+), 1 deletion(-)
c596b8
c596b8
diff --git a/usb_modeswitch.c b/usb_modeswitch.c
c596b8
index cbb8c28..f9c8b2e 100644
c596b8
--- a/usb_modeswitch.c
c596b8
+++ b/usb_modeswitch.c
c596b8
@@ -2021,7 +2021,8 @@ void close_all()
c596b8
 		libusb_close(devh);
c596b8
 	// libusb_exit will crash on Raspbian 7, crude protection
c596b8
 #ifndef __ARMEL__
c596b8
-	libusb_exit(NULL);
c596b8
+	if (ctx)
c596b8
+		libusb_exit(NULL);
c596b8
 #endif
c596b8
 	if (sysmode)
c596b8
 		closelog();
c596b8
-- 
c596b8
2.7.4
c596b8