diff options
author | Szymon Janc <szymon.janc@codecoup.pl> | 2015-10-16 12:24:09 +0200 |
---|---|---|
committer | Szymon Janc <szymon.janc@codecoup.pl> | 2015-10-30 11:44:19 +0100 |
commit | 97075679fe12d96fb433a1cac860e5dd90538e72 (patch) | |
tree | ce21f4b709249050f4153b7acf057bdb66c2ca52 /android/handsfree-client.c | |
parent | 962285c7cf3719e59db1a351ae615e87d3f242ad (diff) | |
download | bluez-97075679fe12d96fb433a1cac860e5dd90538e72.tar.gz |
android: Remove dead code
This removes dead code due to memory allocation with new0 not being
able to fail.
Diffstat (limited to 'android/handsfree-client.c')
-rw-r--r-- | android/handsfree-client.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/android/handsfree-client.c b/android/handsfree-client.c index 0e2bd40a3..65659b899 100644 --- a/android/handsfree-client.c +++ b/android/handsfree-client.c @@ -177,14 +177,6 @@ static struct device *device_create(const bdaddr_t *bdaddr) struct device *dev; dev = new0(struct device, 1); - if (!dev) - return NULL; - - if (!queue_push_tail(devices, dev)) { - error("hf-client: Could not push dev on the list"); - free(dev); - return NULL; - } bacpy(&dev->bdaddr, bdaddr); dev->state = HAL_HF_CLIENT_CONN_STATE_DISCONNECTED; @@ -192,6 +184,8 @@ static struct device *device_create(const bdaddr_t *bdaddr) init_codecs(dev); + queue_push_tail(devices, dev); + return dev; } @@ -2166,10 +2160,6 @@ bool bt_hf_client_register(struct ipc *ipc, const bdaddr_t *addr) DBG(""); devices = queue_new(); - if (!devices) { - error("hf-client: Could not create devices list"); - goto failed; - } bacpy(&adapter_addr, addr); |