public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
* [PATCH -next] caif_virtio: fix error return code in cfv_create_genpool()
@ 2013-03-22 13:16 Wei Yongjun
  2013-03-22 14:02 ` Sjur BRENDELAND
  2013-03-22 14:24 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Wei Yongjun @ 2013-03-22 13:16 UTC (permalink / raw)
  To: sjur.brandeland, rusty; +Cc: yongjun_wei, netdev

From: Wei Yongjun <yongjun_wei@trendmicro•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@trendmicro•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;

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-03-25 23:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-22 13:16 [PATCH -next] caif_virtio: fix error return code in cfv_create_genpool() Wei Yongjun
2013-03-22 14:02 ` Sjur BRENDELAND
2013-03-22 14:24 ` David Miller
2013-03-22 14:27   ` Sjur BRENDELAND
2013-03-25 10:13     ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox