Skip to content

Commit

Permalink
qed: Handle management FW error
Browse files Browse the repository at this point in the history
commit 20e100f upstream.

Handle MFW (management FW) error response in order to avoid a crash
during recovery flows.

Changes from v1:
- Add "Fixes tag".

Fixes: tag 5e7ba04 ("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>
  • Loading branch information
smalin1 authored and gregkh committed Sep 22, 2021
1 parent 01d9358 commit 2a791fa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/ethernet/qlogic/qed/qed_mcp.c
Expand Up @@ -3368,6 +3368,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 */
Expand Down Expand Up @@ -3396,7 +3397,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;
Expand Down

0 comments on commit 2a791fa

Please sign in to comment.