uorb: fix, should check min_interval modified by lowerhalf.

Signed-off-by: jihandong <jihandong@xiaomi.com>
This commit is contained in:
jihandong 2022-06-25 17:12:39 +08:00 committed by Xiang Xiao
parent fe1d83c41b
commit 12e5371a05

View File

@ -250,11 +250,16 @@ static int sensor_update_interval(FAR struct file *filep,
if (min_interval != ULONG_MAX &&
min_interval != upper->state.min_interval)
{
unsigned long expected_interval = min_interval;
ret = lower->ops->set_interval(lower, filep, &min_interval);
if (ret < 0)
{
return ret;
}
else if (min_interval > expected_interval)
{
return -EINVAL;
}
}
if (min_latency == ULONG_MAX)