From: Wenwen Wang <wenwen@cs.uga.edu>
To: Wenwen Wang <wenwen@cs.uga.edu>
Cc: Derek Chickles <dchickles@marvell.com>,
Satanand Burla <sburla@marvell.com>,
Felix Manlunas <fmanlunas@marvell.com>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org (open list:CAVIUM LIQUIDIO NETWORK DRIVER),
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] liquidio: add cleanup in octeon_setup_iq()
Date: Wed, 14 Aug 2019 00:14:49 -0500 [thread overview]
Message-ID: <1565759689-5941-1-git-send-email-wenwen@cs.uga.edu> (raw)
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
next reply other threads:[~2019-08-14 5:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-14 5:14 Wenwen Wang [this message]
2019-08-15 19:37 ` [PATCH] liquidio: add cleanup in octeon_setup_iq() David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1565759689-5941-1-git-send-email-wenwen@cs.uga.edu \
--to=wenwen@cs.uga.edu \
--cc=davem@davemloft.net \
--cc=dchickles@marvell.com \
--cc=fmanlunas@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sburla@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).