Fix the incorrect return value handling in bt_hcicore.c/hc_sr04.c

Report by juniskane

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2020-01-09 15:31:52 -03:00 committed by Alan Carvalho de Assis
commit 51eaed8765
2 changed files with 2 additions and 2 deletions

View File

@ -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 */

View File

@ -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();