/* Release all or part of the blocks occupied by the buffer. */
static int release_tx_buffer(struct backend_data *dev_data, const uint8_t *buffer, int new_size)
/* Release all or part of the blocks occupied by the buffer. */
static int release_tx_buffer(struct backend_data *dev_data, const uint8_t *buffer, int new_size)
{
	const struct icbmsg_config *conf = dev_data->conf;
	size_t size;
	int tx_block_index;
	tx_block_index = buffer_to_index_validate(&conf->tx, buffer, &size);
	if (tx_block_index < 0) {
		return tx_block_index;
	}
	return release_tx_blocks(dev_data, tx_block_index, size, new_size);
}