[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPgLHd-VdCq3qfDGYpCE1VmPeHGFneyR3TaarS=bMROqWmj2uA@mail.gmail.com>
Date: Fri, 22 Mar 2013 21:16:52 +0800
From: Wei Yongjun <weiyj.lk@...il.com>
To: sjur.brandeland@...ricsson.com, rusty@...tcorp.com.au
Cc: yongjun_wei@...ndmicro.com.cn, netdev@...r.kernel.org
Subject: [PATCH -next] caif_virtio: fix error return code in cfv_create_genpool()
From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
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@...ndmicro.com.cn>
---
drivers/net/caif/caif_virtio.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/caif/caif_virtio.c b/drivers/net/caif/caif_virtio.c
index f6caa1e..43b1b75 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)
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;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists