Skip to content

Commit

Permalink
qed: Add cleanup in qed_slowpath_start()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Sudarsana Reddy Kalluru <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
wenwenwang1 authored and davem330 committed Aug 22, 2019
1 parent a71d9ef commit de0e4fd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/ethernet/qlogic/qed/qed_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1325,14 +1325,16 @@ 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;
}
}

qed_reset_vport_stats(cdev);

return 0;

err4:
qed_ll2_dealloc_if(cdev);
err3:
qed_hw_stop(cdev);
err2:
Expand Down

0 comments on commit de0e4fd

Please sign in to comment.