summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShai Malin <smalin@marvell.com>2021-09-10 11:33:56 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-09-22 12:27:58 +0200
commit5221e66329910239df788f2cf49f4acc072f86d0 (patch)
tree18664cf35fc1dddb446122665aae4493b9ffe0c4
parente00eae1d6b1fb8eecb1250fdcadcc97ea391cbe5 (diff)
downloadlinux-stable-5221e66329910239df788f2cf49f4acc072f86d0.tar.gz
linux-stable-5221e66329910239df788f2cf49f4acc072f86d0.tar.bz2
linux-stable-5221e66329910239df788f2cf49f4acc072f86d0.zip
qed: Handle management FW error
commit 20e100f52730cd0db609e559799c1712b5f27582 upstream. Handle MFW (management FW) error response in order to avoid a crash during recovery flows. Changes from v1: - Add "Fixes tag". Fixes: tag 5e7ba042fd05 ("qed: Fix reading stale configuration information") Signed-off-by: Ariel Elior <aelior@marvell.com> Signed-off-by: Shai Malin <smalin@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/ethernet/qlogic/qed/qed_mcp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_mcp.c b/drivers/net/ethernet/qlogic/qed/qed_mcp.c
index caeef25c89bb..2cd14ee95c1f 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_mcp.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_mcp.c
@@ -3376,6 +3376,7 @@ qed_mcp_get_nvm_image_att(struct qed_hwfn *p_hwfn,
struct qed_nvm_image_att *p_image_att)
{
enum nvm_image_type type;
+ int rc;
u32 i;
/* Translate image_id into MFW definitions */
@@ -3404,7 +3405,10 @@ qed_mcp_get_nvm_image_att(struct qed_hwfn *p_hwfn,
return -EINVAL;
}
- qed_mcp_nvm_info_populate(p_hwfn);
+ rc = qed_mcp_nvm_info_populate(p_hwfn);
+ if (rc)
+ return rc;
+
for (i = 0; i < p_hwfn->nvm_info.num_images; i++)
if (type == p_hwfn->nvm_info.image_att[i].image_type)
break;