[PATCH 2/2] shared/btp: Allow to call btp_send without valid btp

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

 



This allows to unconditionally call btp_send from code that generates
events eg when mapping those from D-Bus events.
---
 src/shared/btp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/shared/btp.c b/src/shared/btp.c
index 555dabc39..7eea241a2 100644
--- a/src/shared/btp.c
+++ b/src/shared/btp.c
@@ -294,6 +294,9 @@ bool btp_send(struct btp *btp, uint8_t service, uint8_t opcode, uint8_t index,
 	struct pending_message *msg;
 	size_t len;
 
+	if (!btp)
+		return false;
+
 	len = sizeof(*hdr) + length;
 	hdr = l_malloc(len);
 	if (!hdr)
-- 
2.14.3

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