Commit 1aef76e9 authored by Wei Yongjun's avatar Wei Yongjun Committed by Rusty Russell

caif_virtio: fix error return code in cfv_create_genpool()

Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: default avatarSjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 916cdabc
...@@ -424,8 +424,10 @@ static int cfv_create_genpool(struct cfv_info *cfv) ...@@ -424,8 +424,10 @@ static int cfv_create_genpool(struct cfv_info *cfv)
cfv->reserved_size = num_possible_cpus() * cfv->ndev->mtu; cfv->reserved_size = num_possible_cpus() * cfv->ndev->mtu;
cfv->reserved_mem = gen_pool_alloc(cfv->genpool, cfv->reserved_mem = gen_pool_alloc(cfv->genpool,
cfv->reserved_size); cfv->reserved_size);
if (!cfv->reserved_mem) if (!cfv->reserved_mem) {
err = -ENOMEM;
goto err; goto err;
}
cfv->watermark_tx = virtqueue_get_vring_size(cfv->vq_tx); cfv->watermark_tx = virtqueue_get_vring_size(cfv->vq_tx);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment