From 55defb8c158bce4194436aee491ae731cce30af2 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 28 Mar 2006 11:23:04 +0000 Subject: Cleanup --- hcid/security.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'hcid/security.c') diff --git a/hcid/security.c b/hcid/security.c index d2d7ac1e..dabbded0 100644 --- a/hcid/security.c +++ b/hcid/security.c @@ -111,6 +111,7 @@ static int hci_req_find_by_dev(const void *data, const void *user_data) static int check_pending_hci_req(int dev) { + struct hci_req_data *data; struct slist *l; if (!hci_req_queue) @@ -118,20 +119,19 @@ static int check_pending_hci_req(int dev) l = slist_find(hci_req_queue, &dev, hci_req_find_by_dev); - if (l) { - struct hci_req_data *data = l->data; + if (!l) + return -1; - hci_send_cmd(dev, data->ogf, data->ocf, data->clen, data->cparam); + data = l->data; - hci_req_queue = slist_remove(hci_req_queue, data); + hci_send_cmd(dev, data->ogf, data->ocf, data->clen, data->cparam); - free(data->cparam); - free(data); + hci_req_queue = slist_remove(hci_req_queue, data); - return 0; - } + free(data->cparam); + free(data); - return -1; + return 0; } static inline int get_bdaddr(int dev, bdaddr_t *sba, uint16_t handle, bdaddr_t *dba) -- cgit