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.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.c')
-rw-r--r-- | android/handsfree.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/android/handsfree.c b/android/handsfree.c index 2f8a86721..cb348ab9f 100644 --- a/android/handsfree.c +++ b/android/handsfree.c @@ -228,8 +228,6 @@ static struct hf_device *device_create(const bdaddr_t *bdaddr) struct hf_device *dev; dev = new0(struct hf_device, 1); - if (!dev) - return NULL; bacpy(&dev->bdaddr, bdaddr); dev->setup_state = HAL_HANDSFREE_CALL_STATE_IDLE; @@ -240,10 +238,7 @@ static struct hf_device *device_create(const bdaddr_t *bdaddr) init_codecs(dev); - if (!queue_push_head(devices, dev)) { - free(dev); - return NULL; - } + queue_push_head(devices, dev); return dev; } @@ -2968,8 +2963,6 @@ bool bt_handsfree_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode, return false; devices = queue_new(); - if (!devices) - return false; if (!enable_hsp_ag()) goto failed_queue; |