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:
parent
c7553acdef
commit
7fd4184d2e
1 changed files with 6 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue