mesh: Fix FPE in overcommit logic.
authorMichał Lowas-Rzechonek <michal.lowas-rzechonek@silvair.com>
Tue, 31 Mar 2020 09:04:00 +0000 (11:04 +0200)
committerAbhay Agarwal <ay.agarwal@samsung.com>
Fri, 18 Dec 2020 05:40:30 +0000 (11:10 +0530)
commit8417dbb755c79f5799894b1d20afd58deba121c0
tree5a997a8d5b9c0012d7115dee08d8dc74a21834f5
parent8336607fc9d2a0cbb258ce0c46c578fbab6226e6
mesh: Fix FPE in overcommit logic.

During overcommit, mesh_config_save is called in asynchronous mode to
avoid blocking Send() calls. This means that update of cfg->write_time
is scheduled via l_idle_oneshot, so if the next Send() gets scheduled
first, the code may see elapsed time of zero.

If this happens, then the overcommit logic was already executed and the
overcommit is pending, so we can just return.

Change-Id: I13bd46cd94e4a415ebcf2a97cff283bab2d635f4
Signed-off-by: anuj.bhumiya <anuj.bhumiya@samsung.com>
mesh/mesh-config-json.c