This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 1798383  drivers/can: correct checking sem is locked
1798383 is described below

commit 1798383a2d40c0059d6d4d1926301ba461e93734
Author: Oleg Evseev <[email protected]>
AuthorDate: Sun Jul 5 20:56:24 2020 +0300

    drivers/can: correct checking sem is locked
    
    Object filled by nxsem_get_value can be zero or a negative number
    fix for 190782c2959de2b28867022941e52f429d5d07fb
    
    issue #1354
---
 drivers/can/can.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/can/can.c b/drivers/can/can.c
index 2fa30da..d48f852 100644
--- a/drivers/can/can.c
+++ b/drivers/can/can.c
@@ -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);
             }

Reply via email to