Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,10 +619,9 @@ rt_err_t rt_object_for_each(rt_uint8_t type, rt_object_iter_t iter, void *data)
return error >= 0 ? RT_EOK : error;
}
}

rt_spin_unlock_irqrestore(&(information->spinlock), level);

return RT_EOK;
return -RT_ERROR;
}

static rt_err_t _match_name(struct rt_object *obj, void *data)
Expand Down Expand Up @@ -662,13 +661,11 @@ rt_object_t rt_object_find(const char *name, rt_uint8_t type)
/* which is invoke in interrupt status */
RT_DEBUG_NOT_IN_INTERRUPT;

rt_object_for_each(type, _match_name, &data);
if (data != name)
if (rt_object_for_each(type, _match_name, &data) == RT_EOK)
{
return data;
}

return RT_NULL;
return NULL;
}

/**
Expand Down