linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] qed: Add cleanup in qed_slowpath_start()
@ 2019-08-13 10:05 Wenwen Wang
  2019-08-13 10:46 ` [EXT] " Sudarsana Reddy Kalluru
  0 siblings, 1 reply; 3+ messages in thread
From: Wenwen Wang @ 2019-08-13 10:05 UTC (permalink / raw)
  To: Wenwen Wang
  Cc: Ariel Elior, supporter:QLOGIC QL4xxx ETHERNET DRIVER,
	David S. Miller, open list:QLOGIC QL4xxx ETHERNET DRIVER,
	open list

If qed_mcp_send_drv_version() fails, no cleanup is executed, leading to
memory leaks. To fix this issue, redirect the execution to the label 'err3'
before returning the error.

Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
---
 drivers/net/ethernet/qlogic/qed/qed_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c
index 829dd60..d16a251 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_main.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_main.c
@@ -1325,7 +1325,7 @@ static int qed_slowpath_start(struct qed_dev *cdev,
 					      &drv_version);
 		if (rc) {
 			DP_NOTICE(cdev, "Failed sending drv version command\n");
-			return rc;
+			goto err3;
 		}
 	}
 
-- 
2.7.4


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

end of thread, other threads:[~2019-08-21  4:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-13 10:05 [PATCH] qed: Add cleanup in qed_slowpath_start() Wenwen Wang
2019-08-13 10:46 ` [EXT] " Sudarsana Reddy Kalluru
2019-08-21  4:31   ` Wenwen Wang

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).