hw/bus: Add missing debug checks
We should check if APIs are called on proper objects - this is only
valid if "BUS_DEBUG_OS_DEV: 1".
@@ -540,6 +540,8 @@ bus_node_get_lock_timeout(struct os_dev *node)
{
struct bus_node *bnode = (struct bus_node *)node;
+ BUS_DEBUG_VERIFY_NODE(bnode);
+
return bnode->lock_timeout ? bnode->lock_timeout : g_bus_node_lock_timeout;
}
@@ -551,6 +553,8 @@ bus_dev_set_pm(struct os_dev *bus, bus_pm_mode_t pm_mode,
struct bus_dev *bdev = (struct bus_dev *)bus;
int rc;
+ BUS_DEBUG_VERIFY_DEV(bdev);
+
rc = os_mutex_pend(&bdev->lock, OS_TIMEOUT_NEVER);
if (rc) {
return SYS_EACCES;
