Bluetooth: Mesh: cfg_cli: Fix trying to write a NULL pointer

It's not always guaranteed that param->status will be non-NULL,
especially not after a subsequent patch to fix a race condition with
the response waiting.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2018-03-19 16:58:06 +02:00 committed by Johan Hedberg
commit 7fd4184d2e

View file

@ -318,7 +318,9 @@ static void mod_pub_status(struct bt_mesh_model *model,
return;
}
*param->status = status;
if (param->status) {
*param->status = status;
}
if (param->pub) {
param->pub->addr = net_buf_simple_pull_le16(buf);
@ -383,7 +385,9 @@ static void mod_sub_status(struct bt_mesh_model *model,
*param->sub_addr = sub_addr;
}
*param->status = status;
if (param->status) {
*param->status = status;
}
k_sem_give(&cli->op_sync);
}