Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2351625pxb; Mon, 20 Sep 2021 19:47:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhEISuCrtDfk5IgVQPJHHEB3oMNZyABH3CjlQuI4R6bjQQ6MBhM8qFVVXpYlfCnhfVMjK2 X-Received: by 2002:a6b:5a08:: with SMTP id o8mr21174371iob.35.1632192470513; Mon, 20 Sep 2021 19:47:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192470; cv=none; d=google.com; s=arc-20160816; b=gad742Gx+OoLdvHW+awW2lBf1aPgB2Wd7J+do2OQ11+Si0AXMGSazQ5CoS6DYfSVl0 OjhtoNyMLFUr8I9+m7NMpN5wHy66DtZMBcA1TR07pbfQdEmRmsRGcH3ATiLORQ3eYOw/ Nm332dY5HueKJCMA1++5FjOJopcNepVIwZDXhxEJjcg+zPtKprqEkgtRAgvuPDMLvGy8 WYpMJgVKgRnxpXO3SSxxcs5Eyg7hs0S/fB0iIPYfbEMEBf4UL8NgMAZVZ5FTckljEwuO sl4DsHWZHmxcgrOM2tf/xrXTHilUuZzPsMJx3A3Z+N7Mg8XooZYHVAFP2X/PtKeby8cO tVww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LSzQVgyvfdo5mgSCzQZ4NY3DbctmOaUSQdFt9l3mEvA=; b=fHq+xgr/KFSYkdA9vuYoMfkweqGQUPiCwxM1aicbcTsLyDlDstNGK0x11bT8FhZtMV CIMUJNfIgj30k936qDfgpoJ+KMc+4GXlh3BXUWurciCvX0JXQ1DkUf1Fn6BT756Dq2O0 71dV5B950NEGypyKx0LR7zIq7JVcDXKn/TbEtopZCTvkm+oJvrozcpX0rh2gC9/C2jnr im/c63edqNGhQ2yLo6G9cz0bfS7lRRmrYSLT3oOM2c9jfEb47fhQ2hfmfJ4kknwSh+1N vRdEbFsk82gKZt4UdLlzCo1nSoOsCiStetNNbos5rqeQ66lSSkaQ2Pw92/N7ojrmnUUI O5aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tpGV1iWL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s9si14532888ilu.57.2021.09.20.19.47.39; Mon, 20 Sep 2021 19:47:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tpGV1iWL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1380396AbhITSdp (ORCPT + 99 others); Mon, 20 Sep 2021 14:33:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:48138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378883AbhITS0y (ORCPT ); Mon, 20 Sep 2021 14:26:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3B91F632D6; Mon, 20 Sep 2021 17:26:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158762; bh=r2MxMQfax9AZlYGwWJanIe6mzDxRLMDqrXLsslA3azc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tpGV1iWL7xRnPUvhK9t+Q3B6/6ig0OkOz8+rQQLgh93xOP9ZPgS5xVZZVxYvD3fWP iQ3mlA/b27evXTj/RWsXMNzXmGoh9xyrn+j8yph7XVFhaN3f+W1NNedLOKNqiQw0JR i7EMfrYCFGUB1PeMuzZ+T4y4SgHgnwHzENi1ew8s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ariel Elior , Shai Malin , "David S. Miller" Subject: [PATCH 5.10 044/122] qed: Handle management FW error Date: Mon, 20 Sep 2021 18:43:36 +0200 Message-Id: <20210920163917.237769778@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163915.757887582@linuxfoundation.org> References: <20210920163915.757887582@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shai Malin 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 Signed-off-by: Shai Malin Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/qlogic/qed/qed_mcp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- 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_hwf 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_hwf 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;