aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/rfcomm
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-10-15 11:31:05 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-10-16 02:14:32 -0400
commitb2cfcd75df77b80d9cc3fa84190a350dfa79eb93 (patch)
tree661abc82652a6cc7ff665861d98d127e2152affc /net/bluetooth/rfcomm
parente86070c83e9110e89800274385c013db602b1444 (diff)
[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/rfcomm')
-rw-r--r--net/bluetooth/rfcomm/tty.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index 1958ad1b8541..5833b87c51cf 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -172,12 +172,10 @@ static struct device *rfcomm_get_device(struct rfcomm_dev *dev)
172 return NULL; 172 return NULL;
173 173
174 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &dev->dst); 174 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &dev->dst);
175 if (!conn)
176 return NULL;
177 175
178 hci_dev_put(hdev); 176 hci_dev_put(hdev);
179 177
180 return &conn->dev; 178 return conn ? &conn->dev : NULL;
181} 179}
182 180
183static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc) 181static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc)