netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cnic: Fix an error handling path in 'cnic_alloc_bnx2x_resc()'
@ 2017-09-21 23:01 Christophe JAILLET
  2017-09-24  0:04 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2017-09-21 23:01 UTC (permalink / raw)
  To: jmaxwell37, davem, stephen, danielj, parav
  Cc: netdev, linux-kernel, kernel-janitors, Christophe JAILLET

All the error handling paths 'goto error', except this one.
We should also go to error in this case, or some resources will be
leaking.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/net/ethernet/broadcom/cnic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c
index cec94bbb2ea5..8bc126a156e8 100644
--- a/drivers/net/ethernet/broadcom/cnic.c
+++ b/drivers/net/ethernet/broadcom/cnic.c
@@ -1278,7 +1278,7 @@ static int cnic_alloc_bnx2x_resc(struct cnic_dev *dev)
 
 	ret = cnic_alloc_dma(dev, kwq_16_dma, pages, 0);
 	if (ret)
-		return -ENOMEM;
+		goto error;
 
 	n = CNIC_PAGE_SIZE / CNIC_KWQ16_DATA_SIZE;
 	for (i = 0, j = 0; i < cp->max_cid_space; i++) {
-- 
2.11.0

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

* Re: [PATCH] cnic: Fix an error handling path in 'cnic_alloc_bnx2x_resc()'
  2017-09-21 23:01 [PATCH] cnic: Fix an error handling path in 'cnic_alloc_bnx2x_resc()' Christophe JAILLET
@ 2017-09-24  0:04 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-09-24  0:04 UTC (permalink / raw)
  To: christophe.jaillet
  Cc: jmaxwell37, stephen, danielj, parav, netdev, linux-kernel,
	kernel-janitors

From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Date: Fri, 22 Sep 2017 01:01:11 +0200

> All the error handling paths 'goto error', except this one.
> We should also go to error in this case, or some resources will be
> leaking.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Applied, thank you.

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

end of thread, other threads:[~2017-09-24  0:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-21 23:01 [PATCH] cnic: Fix an error handling path in 'cnic_alloc_bnx2x_resc()' Christophe JAILLET
2017-09-24  0:04 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).