mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 02:02:28 +09:00
qed: Add cleanup in qed_slowpath_start()
[ Upstream commit de0e4fd2f0 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1f4c2d6aea
commit
c37ae2a30a
@@ -1081,7 +1081,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1089,6 +1089,8 @@ static int qed_slowpath_start(struct qed_dev *cdev,
|
||||
|
||||
return 0;
|
||||
|
||||
err4:
|
||||
qed_ll2_dealloc_if(cdev);
|
||||
err3:
|
||||
qed_hw_stop(cdev);
|
||||
err2:
|
||||
|
||||
Reference in New Issue
Block a user