mirror of
https://github.com/apache/nuttx.git
synced 2026-05-26 02:36:11 +08:00
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:
committed by
Alan Carvalho de Assis
parent
908ee31e7d
commit
1798383a2d
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user