* [PATCH 3/4] Bluetooth: hidp: Only free input device if failed register
@ 2011-08-05 14:51 Peter Hurley
0 siblings, 0 replies; only message in thread
From: Peter Hurley @ 2011-08-05 14:51 UTC (permalink / raw)
To: linux-bluetooth
When an hidp connection is added for a boot protocol input
device, only free the allocated device if device registration fails.
Subsequent failures should only unregister the device (the input
device api documents that unregister will also free the allocated
device).
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
---
net/bluetooth/hidp/core.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index 26f0d10..a859f90 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -842,6 +842,8 @@ static int hidp_setup_input(struct hidp_session *session,
err = input_register_device(input);
if (err < 0) {
+ input_free_device(input);
+ session->input = NULL;
hci_conn_put_device(session->conn);
return err;
}
@@ -1089,7 +1091,6 @@ purge:
failed:
up_write(&hidp_session_sem);
- input_free_device(session->input);
kfree(session);
return err;
}
--
1.7.4.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-08-05 14:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-05 14:51 [PATCH 3/4] Bluetooth: hidp: Only free input device if failed register Peter Hurley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).