ipc: icmsg: Check return error of pbuf_rx_init()

When pbuf_rx_init() was added, this caller did not check for a possibly
returned error to not have more overhead than before using this
function.
Although unlikely let's check for a possible error (not configured Rx
pbuf cfg).

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras 2024-09-26 12:09:53 +02:00 committed by Alberto Escolar
parent 5742b27078
commit ca26820ac1

View file

@ -273,11 +273,16 @@ int icmsg_open(const struct icmsg_config_t *conf,
int ret = pbuf_tx_init(dev_data->tx_pb);
if (ret < 0) {
__ASSERT(false, "Incorrect configuration");
__ASSERT(false, "Incorrect Tx configuration");
return ret;
}
(void)pbuf_rx_init(dev_data->rx_pb);
ret = pbuf_rx_init(dev_data->rx_pb);
if (ret < 0) {
__ASSERT(false, "Incorrect Rx configuration");
return ret;
}
ret = pbuf_write(dev_data->tx_pb, magic, sizeof(magic));