diff --git a/subsys/bluetooth/mesh/cfg_cli.c b/subsys/bluetooth/mesh/cfg_cli.c index be13d15635b..8ff60cd22c8 100644 --- a/subsys/bluetooth/mesh/cfg_cli.c +++ b/subsys/bluetooth/mesh/cfg_cli.c @@ -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;