Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2346525pxb; Mon, 20 Sep 2021 19:36:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzun1Rq7tqPHaVAEBvKDu5/Y4kJqKh75zgcRdOQdJ9f/AJzoUS2Fo3Uc6GH1WjVL6z7U62i X-Received: by 2002:a6b:7016:: with SMTP id l22mr9611671ioc.48.1632191804828; Mon, 20 Sep 2021 19:36:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632191804; cv=none; d=google.com; s=arc-20160816; b=iESFcYruq+fv8wQRuAUL5ThdwVI2xsGSthtgG9haA+zFT0V92UO475+ubocBLMYiOp gHjBz/Ls8jQfPAiTIADlsnKbwmWe9KLIPtcxuQ4QPxp6FCfzXkz95FCEbejgZU8B7GYc 6PV5Aj+/jqG/nsdhk3+exaAiWUyt209w7dzjYi0fQekoHDz9pWrJmIbiLFToOfv5LoAW Vo8oM/Pk4yNVH378hNYhh0Nf49PGVwwzdXU6ru44ZHMugavcgK9jHJoV1t541xnXuUrq t2rwnQCpJoBuNi+Ie/kjUVxfxpGkp8sG8N3d3Yv+BWQSp+0pJVK6xB68SoRgB+/TEYsr u1kg== 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=UZHlJCh7M7bo9ishiUtGg3lKkJmVRT2RgndOyNxg+wA=; b=cwk9tvzj0E+m3I5DNfPhTuOLqGQr4FilUDOCR7nwOFiucAQvYlP+atiLmuqR5USKU4 aFzTQakrU448NRxmx5PBO98ib6PeRXxNd9Ut0l8kYNvUArmT7eFYBaXSTTTlhL+EXM3h 7MAQ0mp5PO6EIjHg8HbkpDet1EOxFSikY/T7/OAOXiIVpy8Ko4y77XJe4uckzGaItOs7 IpyVafS9Le+3mJSx1DW7QxS5R6gSxy9A2dd1mxskMPcAblXrQZGbDAs1c8IRpO/i8khF cJQ60vBmV6s2czfehHrHQmH1DXuEK69mEq1r13MwAdwJ43cytNGPeVsZdk0nmOK3eahb BY7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WnzmzBrF; 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 v11si15647023jas.4.2021.09.20.19.36.26; Mon, 20 Sep 2021 19:36:44 -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=WnzmzBrF; 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 S1350847AbhITSCn (ORCPT + 99 others); Mon, 20 Sep 2021 14:02:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:54550 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354097AbhITRzy (ORCPT ); Mon, 20 Sep 2021 13:55:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 967D6619E5; Mon, 20 Sep 2021 17:14:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158047; bh=U4AX/ml/flG1WptvB3W+R34y7qfvFf6e8Q43XXtlqdM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WnzmzBrFZYy9asw2CyXK4l0M1lCHNxB793OFMhm45OxG3uxXGIJUwmlUliWATaFoi uLa/6lGjXQxlfBVkVSi2VQWuJJ906jtiaSn8zPxQa1hw/nLkLv+v7qd7E2uCvFGKUO bB1tV89NTnV1hqTvh/JVFeqT4p1xFu0V4+KSJ+6w= 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 4.19 270/293] qed: Handle management FW error Date: Mon, 20 Sep 2021 18:43:52 +0200 Message-Id: <20210920163942.652587172@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163933.258815435@linuxfoundation.org> References: <20210920163933.258815435@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 @@ -2841,6 +2841,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 */ @@ -2866,7 +2867,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;