diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2006-10-15 19:31:05 +0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-10-16 10:14:32 +0400 |
commit | b2cfcd75df77b80d9cc3fa84190a350dfa79eb93 (patch) | |
tree | 661abc82652a6cc7ff665861d98d127e2152affc /net/bluetooth/hidp | |
parent | e86070c83e9110e89800274385c013db602b1444 (diff) | |
download | linux-b2cfcd75df77b80d9cc3fa84190a350dfa79eb93.tar.xz |
[Bluetooth] Fix reference count when connection lookup fails
When the connection lookup for the device structure fails, the reference
count for the HCI device needs to be decremented.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hidp')
-rw-r--r-- | net/bluetooth/hidp/core.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c index b2d6da67d885..9a562cf7406b 100644 --- a/net/bluetooth/hidp/core.c +++ b/net/bluetooth/hidp/core.c @@ -541,12 +541,10 @@ static struct device *hidp_get_device(struct hidp_session *session) return NULL; conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, dst); - if (!conn) - return NULL; hci_dev_put(hdev); - return &conn->dev; + return conn ? &conn->dev : NULL; } static inline void hidp_setup_input(struct hidp_session *session, struct hidp_connadd_req *req) |