[PATCH] gatt: Fix NULL pointer dereference

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

 



From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx>

Safely return in case of error.
---
 peripheral/gatt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/peripheral/gatt.c b/peripheral/gatt.c
index 8df62a6..6cf2b79 100644
--- a/peripheral/gatt.c
+++ b/peripheral/gatt.c
@@ -178,6 +178,7 @@ static void att_conn_callback(int fd, uint32_t events, void *user_data)
 	if (!conn) {
 		fprintf(stderr, "Failed to create GATT connection\n");
 		close(new_fd);
+		return;
 	}
 
 	if (!queue_push_tail(conn_list, conn)) {
-- 
2.1.4

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