[PATCH BlueZ 1/2] android/hal-audio: Fix not closing audio_sk

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

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

shutdown will only disconnect the peers but it is still needed to close
the file descriptor.
---
 android/hal-audio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/android/hal-audio.c b/android/hal-audio.c
index 2f6f8c2..0b4577e 100644
--- a/android/hal-audio.c
+++ b/android/hal-audio.c
@@ -246,6 +246,7 @@ static void audio_ipc_cleanup(void)
 {
 	if (audio_sk >= 0) {
 		shutdown(audio_sk, SHUT_RDWR);
+		close(audio_sk);
 		audio_sk = -1;
 	}
 }
@@ -1090,6 +1091,7 @@ static void *ipc_handler(void *data)
 
 		if (pfd.revents & (POLLHUP | POLLERR | POLLNVAL)) {
 			info("Audio HAL: Socket closed");
+			close(audio_sk);
 			audio_sk = -1;
 		}
 
-- 
1.8.4.2

--
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