[PATCH 1/2] android/tester: Fix closing file descriptor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Don't close file descriptor if failed to create it.
---
 android/android-tester.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/android/android-tester.c b/android/android-tester.c
index 09c76c9..d7e80fb 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -390,7 +390,9 @@ static void emulator(int pipe, int hci_index)
 
 failed:
 	close(pipe);
-	close(fd);
+
+	if (fd >= 0)
+		close(fd);
 }
 
 static void adapter_state_changed_cb(bt_state_t state)
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux