Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2353490pxb; Mon, 20 Sep 2021 19:51:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqjE8wNa+gKnsxX80QRZKGBG5e9uQnlmvMDTsytIKZCSm1yXuJwy0FgjQSOsut6ES/9ZoG X-Received: by 2002:a5d:9051:: with SMTP id v17mr17929211ioq.134.1632192711006; Mon, 20 Sep 2021 19:51:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192710; cv=none; d=google.com; s=arc-20160816; b=d+0b9ISMo6dwXsaIL4be6UjCWRs+kA9jWM3nMmDJqeCotS8a+tzn6MbI06osQNYXHN UmOcIJJBJcdY5CwKrcBbBi+fq7XB7Kpj/NuiXpNVDRbWmgaS1aLayvHwqVURQWan1xsc GwFj+TjJ3Xf70yKcmAiXUeMNhoCDXM+yH0tgdLaL3SQZely3z16YU+4ntWb1d07OM9PW ZkZkQ4405AJ2uYvm5UwHlHbNoWQ70/UUis4ADSjYLeGNoPR4QRlgL+ATALdnJkvRaGd1 G/wfLtfIhhTIu1/Pb4T43Yh0LhvdiK3+EFyPqSXQD2eeo3KFRG5C0NWMVns6xsK+BvdT 5GIw== 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=EJWCzsUBKuucEdeLFc8T9MAz/kJ6BrvKxXWV/iKWxv4=; b=L7ZbmbZj5dptDbCeatb2tAPhCZ4RMOhGONHiHhT+UReD/2gdJi6wkk5+l+sfXwTS1g 6Hwg8abpvCxUJU0z8kzcrZlU6VYTtE3zAVyms1QLuGyF1BHnvkwobyidJOxGxikO69eZ r2cmOYTiI/SkrLdEKvRbCQZEM4rMVVlOLMaTFUY2TP9d+ADRc7T+R3kGieBdeYp2YoxU j2dMa8t1RI/qZoso+a+aBJ9LvDQDleiftSqWvvxPqTNDdKm7lO1br+/B3DObzip6PP51 l1rH2GLdNfFoET+LY7Hsbx/yZIQtoag4byC0W1N4M4+rcvqEjyJkWKhMhLiJPZnW6W+m vahA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZeDAfSVU; 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 k26si7972996ioh.55.2021.09.20.19.51.38; Mon, 20 Sep 2021 19:51: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=ZeDAfSVU; 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 S1349652AbhITSrd (ORCPT + 99 others); Mon, 20 Sep 2021 14:47:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:56446 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383234AbhITSoR (ORCPT ); Mon, 20 Sep 2021 14:44:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 355CA61AFD; Mon, 20 Sep 2021 17:32:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632159148; bh=1aStcyYa0yll05I7CgTX2aAWnzcLR8tVVLBn72rmAJ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZeDAfSVUpMOfMcPP1+565Y5OOkWgyTvfdXlzLTHHCxKqqtyPZh5UjKIwBMJs5w3n/ 1fHyEIO4e4jlaSLic38hPfwfbhViBrtkYlo4AnDhm9MKqxzbzHEywCtBdfpxM9Xfpo qXZTtLWEQkY92xjP0vuhFjIiLPCmM3YErjFH1mxk= 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.14 066/168] qed: Handle management FW error Date: Mon, 20 Sep 2021 18:43:24 +0200 Message-Id: <20210920163923.807959108@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163921.633181900@linuxfoundation.org> References: <20210920163921.633181900@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 @@ -3368,6 +3368,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 */ @@ -3396,7 +3397,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;