diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-04-02 02:15:56 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2013-04-02 02:18:25 -0400 |
commit | 1aef76e9c4c616c91233ece9850e89c91f3fd92a (patch) | |
tree | 5ea2b9d27e0b419287e1ba8965744fd884edf5f9 | |
parent | 916cdabc31cc245f4ae81d8113e24446225874c8 (diff) |
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: 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>
-rw-r--r-- | drivers/net/caif/caif_virtio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/caif/caif_virtio.c b/drivers/net/caif/caif_virtio.c index 316b184ea130..0e3bede8b8a8 100644 --- a/drivers/net/caif/caif_virtio.c +++ b/drivers/net/caif/caif_virtio.c | |||
@@ -424,8 +424,10 @@ static int cfv_create_genpool(struct cfv_info *cfv) | |||
424 | cfv->reserved_size = num_possible_cpus() * cfv->ndev->mtu; | 424 | cfv->reserved_size = num_possible_cpus() * cfv->ndev->mtu; |
425 | cfv->reserved_mem = gen_pool_alloc(cfv->genpool, | 425 | cfv->reserved_mem = gen_pool_alloc(cfv->genpool, |
426 | cfv->reserved_size); | 426 | cfv->reserved_size); |
427 | if (!cfv->reserved_mem) | 427 | if (!cfv->reserved_mem) { |
428 | err = -ENOMEM; | ||
428 | goto err; | 429 | goto err; |
430 | } | ||
429 | 431 | ||
430 | cfv->watermark_tx = virtqueue_get_vring_size(cfv->vq_tx); | 432 | cfv->watermark_tx = virtqueue_get_vring_size(cfv->vq_tx); |
431 | return 0; | 433 | return 0; |