Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3284020ybb; Tue, 31 Mar 2020 02:04:30 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtuBLbOdavsgoRdsfKHnbwMVQ3VWAptEZWfrs/MDlKT4tR7H7CPzpH9dVkoLrK5zXro4t4i X-Received: by 2002:a4a:240f:: with SMTP id m15mr7411649oof.85.1585645470316; Tue, 31 Mar 2020 02:04:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585645470; cv=none; d=google.com; s=arc-20160816; b=so2X/HI592uKc/K8gm2iY7C7PwMSbWtnQeQacYL3ehSGFFXdewAVbpCPnpQQ1J8kOG ZZ8YkwqI+sFQBlUJ21KHf8/IdCw2hhcgB1It+nrlpWpWe1QE0tEvnf6ocZm0vM7yna/j 9AYCerDQpXOZFeC2VsihK21Gy2k3K/MrA0bwndUHcvW9KxtqpZ+anv93xO8RsHRTBRKS TuAODJ1j6qUN8N6Iwj72iT2G/jDBzRYWmS2yqasiRuUK8BkNRgwxDPwScF3P6tuX/LJh b4tFddleKKTKh1uPUrI/AuLC8NwQmgScweT5YQKZ0DaL7ZEE/y+cU0pr/7V0Wr4ViOvd woXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Fd8rMFeyuUnxlMIRQrobU5m5TAa6c3iqpy7v8Yli9VY=; b=bpwhndOorXENS1IsI8iepKC9EmgBm/Hl768f8cqa5KXE8fch5X1jIRG3Tor3Nv3KG2 C4HNB2H0PPfyA0jjXVSQxwvqIKskZWJMCtOYWMapTtuSU4hPqaMxgQd+cpLeEzUpzwxa 1wDky90KMckzOUq+Hbtx8OGuHZRwA0X4XHP73X7mpdFOAb6OCziHTmZ6JgsNtSQhIzjf +VQbAEvvBNUq3Pp7/rJ9fqa1iS286C3yKS0bAUkD+Iw5b52c6xob0kGOvMFvu0lKgjnQ 1QB0UbyO9WIXH3FTVnHCROQPmCjaOmhry5RIc36+je1A+/kUOGhKorFBAcLk/Z6XcQ6Y Dk+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vBTDNYrR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10si7846760oti.88.2020.03.31.02.04.18; Tue, 31 Mar 2020 02:04:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vBTDNYrR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730470AbgCaJD3 (ORCPT + 99 others); Tue, 31 Mar 2020 05:03:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:43198 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730428AbgCaJD1 (ORCPT ); Tue, 31 Mar 2020 05:03:27 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 68D75212CC; Tue, 31 Mar 2020 09:03:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645406; bh=P0enmRMPJSTzxpuKOpRs/bk9Xg8HJ5GL0+PLb+c5CKQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vBTDNYrR6EYQuFko1vz9uiGtCMu6z628ANYAwILrT3FikaKuYkp8qaionLstIUa7T LkQAAmCrZMr68teTz8We1z7Ej/EmVbA6fwWBac5PbJCEnTTgtB0FleLNePmJxrEPqZ JFhq1G31U2JCKCgkTYwxD9w9e8iVNz2Mfaejo9ig= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Chan , "David S. Miller" Subject: [PATCH 5.5 044/170] bnxt_en: Return error if bnxt_alloc_ctx_mem() fails. Date: Tue, 31 Mar 2020 10:57:38 +0200 Message-Id: <20200331085429.152377971@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Chan [ Upstream commit 0b5b561cea32d5bb1e0a82d65b755a3cb5212141 ] The current code ignores the return value from bnxt_hwrm_func_backing_store_cfg(), causing the driver to proceed in the init path even when this vital firmware call has failed. Fix it by propagating the error code to the caller. Fixes: 1b9394e5a2ad ("bnxt_en: Configure context memory on new devices.") Signed-off-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -6880,12 +6880,12 @@ skip_rdma: } ena |= FUNC_BACKING_STORE_CFG_REQ_DFLT_ENABLES; rc = bnxt_hwrm_func_backing_store_cfg(bp, ena); - if (rc) + if (rc) { netdev_err(bp->dev, "Failed configuring context mem, rc = %d.\n", rc); - else - ctx->flags |= BNXT_CTX_FLAG_INITED; - + return rc; + } + ctx->flags |= BNXT_CTX_FLAG_INITED; return 0; }