mesh: Fix checks when restoring internal model state
authorInga Stotland <inga.stotland@intel.com>
Wed, 3 Jul 2019 20:53:41 +0000 (13:53 -0700)
committerAnupam Roy <anupam.r@samsung.com>
Tue, 17 Dec 2019 15:20:30 +0000 (20:50 +0530)
commita4a1f0383e9611706c2f7884557bf1b99e5ab1e3
tree9bca0515dd65ef79a65f118c43636ae7c4ee5054
parent7c766a7c9bd4ab14005f73b33e1db97cd125c54a
mesh: Fix checks when restoring internal model state

This fixes incorrect conditional checks in restore_model_state()
which could lead to dereferencing a NULL pointer.

Change-Id: I65631b3cd22c9e5f5e43aa62e093c227182749b8
Wrong: if (l_queue_isempty(mod->bindings) || !mod->cbs->bind) ...
Fixed: if (!l_queue_isempty(mod->bindings) && cbs->bind) ...
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
mesh/model.c