Skip to content

Commit

Permalink
caif_virtio: fix error return code in cfv_create_genpool()
Browse files Browse the repository at this point in the history
Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
Wei Yongjun authored and Rusty Russell committed Apr 2, 2013
1 parent 916cdab commit 1aef76e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/caif/caif_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,10 @@ static int cfv_create_genpool(struct cfv_info *cfv)
cfv->reserved_size = num_possible_cpus() * cfv->ndev->mtu;
cfv->reserved_mem = gen_pool_alloc(cfv->genpool,
cfv->reserved_size);
if (!cfv->reserved_mem)
if (!cfv->reserved_mem) {
err = -ENOMEM;
goto err;
}

cfv->watermark_tx = virtqueue_get_vring_size(cfv->vq_tx);
return 0;
Expand Down

0 comments on commit 1aef76e

Please sign in to comment.