diff options
author | Wenwen Wang <wenwen@cs.uga.edu> | 2019-08-21 07:46:36 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-23 02:11:31 +0300 |
commit | de0e4fd2f07ce3bbdb69dfb8d9426b7227451b69 (patch) | |
tree | 6365dd55cb923499e6b7fd809da22cb960545f48 /drivers/net/ethernet/qlogic/qed/qed_main.c | |
parent | a71d9eff9394d24f05cbe115309152fb4543cd6c (diff) | |
download | linux-de0e4fd2f07ce3bbdb69dfb8d9426b7227451b69.tar.xz |
qed: Add cleanup in qed_slowpath_start()
If qed_mcp_send_drv_version() fails, no cleanup is executed, leading to
memory leaks. To fix this issue, introduce the label 'err4' to perform the
cleanup work before returning the error.
Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Acked-by: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qed/qed_main.c')
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c index 829dd60ab937..1efff7f68ef6 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 err4; } } @@ -1333,6 +1333,8 @@ static int qed_slowpath_start(struct qed_dev *cdev, return 0; +err4: + qed_ll2_dealloc_if(cdev); err3: qed_hw_stop(cdev); err2: |