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>
if (!cbs)
return;
- if (l_queue_isempty(mod->bindings) || !mod->cbs->bind) {
+ if (!l_queue_isempty(mod->bindings) && cbs->bind) {
for (b = l_queue_get_entries(mod->bindings); b; b = b->next) {
if (cbs->bind(L_PTR_TO_UINT(b->data), ACTION_ADD) !=
MESH_STATUS_SUCCESS)