bluetooth: mesh : fix relay get param check
check relay get param before use, check relay status param before use Signed-off-by: YanBiao Hao <haoyanbiao@xiaomi.com>
This commit is contained in:
parent
46952106e2
commit
bb8fda2654
@ -188,9 +188,13 @@ static int relay_status(struct bt_mesh_model *model,
|
||||
|
||||
if (bt_mesh_msg_ack_ctx_match(&cli->ack_ctx, OP_RELAY_STATUS, ctx->addr,
|
||||
(void **)¶m)) {
|
||||
if (param->status) {
|
||||
*param->status = status;
|
||||
}
|
||||
|
||||
*param->status = status;
|
||||
*param->transmit = transmit;
|
||||
if (param->transmit) {
|
||||
*param->transmit = transmit;
|
||||
}
|
||||
|
||||
bt_mesh_msg_ack_ctx_rx(&cli->ack_ctx);
|
||||
}
|
||||
@ -1143,6 +1147,10 @@ int bt_mesh_cfg_relay_get(uint16_t net_idx, uint16_t addr, uint8_t *status,
|
||||
};
|
||||
int err;
|
||||
|
||||
if (!status || !transmit) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
err = cli_prepare(¶m, OP_RELAY_STATUS, addr);
|
||||
if (err) {
|
||||
return err;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user