[PATCH] input: Fix crash when connecting HID keyboard

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

 



hidp_add_connection should return after setting up security watch when
connecting HID keyboard, otherwise req will be freed and encrypt_notify
callback will receive invalid pointer.
---
 profiles/input/device.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/profiles/input/device.c b/profiles/input/device.c
index ed178b4..48d397a 100644
--- a/profiles/input/device.c
+++ b/profiles/input/device.c
@@ -663,6 +663,8 @@ static int hidp_add_connection(const struct input_device *idev,
 		iconn->req = req;
 		iconn->sec_watch = g_io_add_watch(iconn->intr_io, G_IO_OUT,
 							encrypt_notify, iconn);
+
+		return 0;
 	}
 
 	err = ioctl_connadd(req);
-- 
1.7.11.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