drivers/can: correct checking sem is locked

Object filled by nxsem_get_value can be zero or a negative number
fix for 190782c295

issue #1354
This commit is contained in:
Oleg Evseev
2020-07-05 20:56:24 +03:00
committed by Alan Carvalho de Assis
parent 908ee31e7d
commit 1798383a2d
+1 -1
View File
@@ -1360,7 +1360,7 @@ int can_receive(FAR struct can_dev_s *dev, FAR struct can_hdr_s *hdr,
* message buffer.
*/
if (sval < 0)
if (sval <= 0)
{
can_givesem(&fifo->rx_sem);
}