diff --git a/subsys/net/lib/lwm2m/lwm2m_registry.c b/subsys/net/lib/lwm2m/lwm2m_registry.c index ce59e488bf20a7..03dae0cca145c4 100644 --- a/subsys/net/lib/lwm2m/lwm2m_registry.c +++ b/subsys/net/lib/lwm2m/lwm2m_registry.c @@ -647,6 +647,7 @@ static int lwm2m_engine_set(const struct lwm2m_obj_path *path, const void *value if (!lwm2m_validate_time_resource_lenghts(max_data_len, len)) { LOG_ERR("Time Set: buffer length %u max data len %zu not supported", len, max_data_len); + k_mutex_unlock(®istry_lock); return -EINVAL; } @@ -928,6 +929,7 @@ static int lwm2m_engine_get(const struct lwm2m_obj_path *path, void *buf, uint16 if (!lwm2m_validate_time_resource_lenghts(data_len, buflen)) { LOG_ERR("Time get buffer length %u data len %zu not supported", buflen, data_len); + k_mutex_unlock(®istry_lock); return -EINVAL; }