From 467ece4ec5b56b23a91eb7e79e429ebb19a920f3 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Fri, 10 Jan 2020 01:59:20 +0800 Subject: [PATCH] Fix the incorrect return value handling in bt_hcicore.c/hc_sr04.c introduced by 6a3c2ade Report by juniskane Signed-off-by: Xiang Xiao --- drivers/sensors/hc_sr04.c | 2 +- wireless/bluetooth/bt_hcicore.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/sensors/hc_sr04.c b/drivers/sensors/hc_sr04.c index e07fea6bdbe2b..3ee8766952d9f 100644 --- a/drivers/sensors/hc_sr04.c +++ b/drivers/sensors/hc_sr04.c @@ -220,7 +220,7 @@ static int hcsr04_ioctl(FAR struct file *filep, int cmd, unsigned long arg) { FAR struct inode *inode = filep->f_inode; FAR struct hcsr04_dev_s *priv = inode->i_private; - int ret; + int ret = OK; /* Get exclusive access */ diff --git a/wireless/bluetooth/bt_hcicore.c b/wireless/bluetooth/bt_hcicore.c index 6e29366a87141..98301ee1c1c17 100644 --- a/wireless/bluetooth/bt_hcicore.c +++ b/wireless/bluetooth/bt_hcicore.c @@ -1759,7 +1759,7 @@ int bt_hci_cmd_send_sync(uint16_t opcode, FAR struct bt_buf_s *buf, * released while we are waiting. */ - nxsem_timedwait_uninterruptible(&sync_sem, &abstime); + ret = nxsem_timedwait_uninterruptible(&sync_sem, &abstime); } sched_unlock();