From bd4233c2c8c564d0e6a699a0088d6b8f07e7b740 Mon Sep 17 00:00:00 2001 From: Andrzej Kaczmarek Date: Tue, 31 Jul 2012 14:48:24 +0200 Subject: [PATCH] input: Fix crash when connecting HID keyboard 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 ed178b41e..48d397ab0 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); -- 2.47.3