You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2018/11/23 16:16:47 UTC

[mynewt-core] 15/26: hw/bus: Fix ignored return value

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

andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 9bb0281e739a7245bb1cdf9f6e31289b6d09f322
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Thu Nov 15 16:52:28 2018 +0100

    hw/bus: Fix ignored return value
---
 hw/bus/src/bus.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/hw/bus/src/bus.c b/hw/bus/src/bus.c
index 60ac70c..6176c41 100644
--- a/hw/bus/src/bus.c
+++ b/hw/bus/src/bus.c
@@ -223,7 +223,7 @@ bus_node_write_read_transact(struct os_dev *node, const void *wbuf,
 {
     struct bus_node *bnode = (struct bus_node *)node;
     struct bus_dev *bdev = bnode->parent_bus;
-    int rc;
+    int rc, rc_unlock;
 
     BUS_DEBUG_VERIFY_DEV(bdev);
     BUS_DEBUG_VERIFY_NODE(bnode);
@@ -259,8 +259,9 @@ bus_node_write_read_transact(struct os_dev *node, const void *wbuf,
     }
 
 done:
-    rc = bus_dev_unlock_by_node(node);
-    assert(rc == 0);
+    /* This shall succeed because we locked it */
+    rc_unlock = bus_dev_unlock_by_node(node);
+    assert(rc_unlock == 0);
 
     return rc;
 }