Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3480690imu; Sun, 11 Nov 2018 16:04:34 -0800 (PST) X-Google-Smtp-Source: AJdET5cosj39kOzwWMErKII/6D8XmVXSCkoCG5wvwC86tD9/f/nVttbW9JtWVfs9on7z1bXx5sZx X-Received: by 2002:a17:902:744b:: with SMTP id e11-v6mr1631032plt.67.1541981074068; Sun, 11 Nov 2018 16:04:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981074; cv=none; d=google.com; s=arc-20160816; b=suV0v6UAxnHxOZnkvewiJtXnT5kPJZA5yvKOd0ZA8SCmfqUX/z5RZbtgjPaYchDtJq vteafgOC+Pl7jE9rcLY4/sDh78K4v4mlBYBmOfuyVegXcA7DjXBMupRd5pqEpXQHXU3v 79Ubao17GvB97uAIdGluNMvHI4hmSGAD0gRmRcI4NgI3zds7jpoHzFIW9AEfhi0zAzBm 3e/koAe3pJ142hEp4bgt+BUgnOg3DcYzWmzayEDLLCqLkx6Xbft8lLvXl7ZvWbpyclmL e4T7RqYsyc8z+RoTJGwpgkUXZeVj8ZNo99YhFst+pW+xB7MsKvomVyVz627nW3fB+xO2 XXjw== 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=EA1fAoQpPAAc/KKq1G5BUi0xDMo7qBkqHNJUL0u0kZw=; b=sQ8gdxUSggWIbdahe7FMgz3+p/m+5lbZ/Hn0WpzMNJYUCrO64hwatID86iyWgHI78Z 03WITuoBUxP7oGcaUuvHPicu+AM0Rq2G63q9N7AJFzUz0R5QnCcrYb1d83iAWBUT46lv otwgmsxSvyMHn4YdGFgBoqqKbjZ/6jfkIab1ORXewspjPco+UHg9i80v9XE9e7oOxgIb zY/LnlyEIlued05D07Mcp7nL0cd1XsO1dw0U0iHj2Xt3nBoW4bdZlU+qM1rrE6NFUrYO GzxNG0mAlOJVZ8RV96qEQ9nRx+Q6MWfqQrIQX7+97SAYSoGpKoLSFKlhOg+68KU4wD7K +a7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="n4IImy/2"; 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 w13-v6si13527752pgj.229.2018.11.11.16.04.19; Sun, 11 Nov 2018 16:04:34 -0800 (PST) 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="n4IImy/2"; 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 S1732172AbeKLJyX (ORCPT + 99 others); Mon, 12 Nov 2018 04:54:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:34412 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732005AbeKLIRt (ORCPT ); Mon, 12 Nov 2018 03:17:49 -0500 Received: from localhost (unknown [206.108.79.134]) (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 A00D02154B; Sun, 11 Nov 2018 22:27:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975273; bh=fjmUlvJoVnY4LOgycvQnbOqoCyevoZuSxAFXLACpwFY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n4IImy/2cA4WT3CFTWRFzHGN/pSt5brR6s9bou5GSVkicpXghZmZABcpYVS6AWxsf //MoZ4TM8gwXK8l9AwlqNXvSX5Dk3p/kaiKN4SYujv0ATi46Gj7h/E5uumjUmRvBPQ KIqWWY6vJT45zdv/IxOZtfGHCHR1T/aEQuS+XzkQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Selvin Xavier , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.19 145/361] RDMA/bnxt_re: Avoid accessing nq->bar_reg_iomem in failure case Date: Sun, 11 Nov 2018 14:18:12 -0800 Message-Id: <20181111221640.825251177@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Selvin Xavier [ Upstream commit ed51efd2ce44091a858ad829f666727e7c95695e ] In the failure path, nq->bar_reg_iomem gets accessed without initializing. Avoid this by calling the bnxt_qplib_nq_stop_irq only if the initialization is complete. Reported-by: Dan Carpenter Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Fixes: 6e04b1035689 ("RDMA/bnxt_re: Fix broken RoCE driver due to recent L2 driver changes") Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c @@ -360,7 +360,8 @@ void bnxt_qplib_disable_nq(struct bnxt_q } /* Make sure the HW is stopped! */ - bnxt_qplib_nq_stop_irq(nq, true); + if (nq->requested) + bnxt_qplib_nq_stop_irq(nq, true); if (nq->bar_reg_iomem) iounmap(nq->bar_reg_iomem);