netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] liquidio: add cleanup in octeon_setup_iq()
@ 2019-08-14  5:14 Wenwen Wang
  2019-08-15 19:37 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Wenwen Wang @ 2019-08-14  5:14 UTC (permalink / raw)
  To: Wenwen Wang
  Cc: Derek Chickles, Satanand Burla, Felix Manlunas, David S. Miller,
	open list:CAVIUM LIQUIDIO NETWORK DRIVER, open list

If oct->fn_list.enable_io_queues() fails, no cleanup is executed, leading
to memory/resource leaks. To fix this issue, invoke
octeon_delete_instr_queue() before returning from the function.

Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
---
 drivers/net/ethernet/cavium/liquidio/request_manager.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cavium/liquidio/request_manager.c b/drivers/net/ethernet/cavium/liquidio/request_manager.c
index 0322241..6dd65f9 100644
--- a/drivers/net/ethernet/cavium/liquidio/request_manager.c
+++ b/drivers/net/ethernet/cavium/liquidio/request_manager.c
@@ -237,8 +237,10 @@ int octeon_setup_iq(struct octeon_device *oct,
 	}
 
 	oct->num_iqs++;
-	if (oct->fn_list.enable_io_queues(oct))
+	if (oct->fn_list.enable_io_queues(oct)) {
+		octeon_delete_instr_queue(oct, iq_no);
 		return 1;
+	}
 
 	return 0;
 }
-- 
2.7.4


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

* Re: [PATCH] liquidio: add cleanup in octeon_setup_iq()
  2019-08-14  5:14 [PATCH] liquidio: add cleanup in octeon_setup_iq() Wenwen Wang
@ 2019-08-15 19:37 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-08-15 19:37 UTC (permalink / raw)
  To: wenwen; +Cc: dchickles, sburla, fmanlunas, netdev, linux-kernel

From: Wenwen Wang <wenwen@cs.uga.edu>
Date: Wed, 14 Aug 2019 00:14:49 -0500

> If oct->fn_list.enable_io_queues() fails, no cleanup is executed, leading
> to memory/resource leaks. To fix this issue, invoke
> octeon_delete_instr_queue() before returning from the function.
> 
> Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>

Applied.

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

end of thread, other threads:[~2019-08-15 19:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-14  5:14 [PATCH] liquidio: add cleanup in octeon_setup_iq() Wenwen Wang
2019-08-15 19:37 ` 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).