Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3930090imm; Mon, 8 Oct 2018 11:52:13 -0700 (PDT) X-Google-Smtp-Source: ACcGV62FiIA5lQQdqtdmdDu4hA0i4rOGS89dP5T1Su3R7Px1GGtHpKcJp4jHLyZ8MIqvqZWY2RZ3 X-Received: by 2002:a63:de05:: with SMTP id f5-v6mr22076013pgg.292.1539024733558; Mon, 08 Oct 2018 11:52:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539024733; cv=none; d=google.com; s=arc-20160816; b=SwGGyOZ8ZZO84OtuhWi8JqAddEtYSnlfRtz7gLK9iXv0Aa5d7Nz31L/H/ehtYgGBg8 bwgT1tHX6F45LsZk7ANxXLgDkIZAvIVZJBI2zDejjhWghRJ/wq1bupskiqMPimltARBi rkWx16WOGjWmkj7mWHGZCbCoGTy4NlQzUZJI0vMSc8lO22mqkM/Csz+JzOhsRuclCgdW hbOo9AFTBa/1Pn6Lm0modMgHRTJ3OI3LalQnGt09DRQig+pg+GD1G55IGfOcmKH1QPVb WtDk9fABUfbx/xn6lW9tJiFjCpoq+GVTE2Im6nUdnCGawbCpFytfVQCTXPzxttgjeD8O tx4A== 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=x5gkYPwV75sRUVx1qpwrfosxdNxehcv3lUmWxpS+b1Q=; b=APY2F6zsH8mgmJrIUGcs8Hh6mZcvj7Sebz7T3L2iqQr28BZZ4Vu6n2UC8+w1/oEDsW DBHWlIDMWYPtv8yMZkXzgucN4OV3iwFTuqxPRdpX44OmZfpb/vcf9EV19r2wRMgCosmt tLHG0Kk9KCtkCGAzAb+8I1ddBlAk/csfWUfKUTeku0K3+GWVhxVcT+gEyxazWlCAR3ni GizJqYEVQvx7aL+BiFUj5WO1iajLXC1MAvGYmhRRzbiMrAhn/Cv8yD/fkCnSBjAwyv3c 53EUAzvv/qa8aEdKQi+rYQFmEzilu9GKBuQsApizGeIQ1QRZt5Lgi2usECdrLjYv4oD7 3uZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bQnsgRLE; 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 b11-v6si20987863plk.302.2018.10.08.11.51.58; Mon, 08 Oct 2018 11:52:13 -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=bQnsgRLE; 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 S1732121AbeJICDn (ORCPT + 99 others); Mon, 8 Oct 2018 22:03:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:53272 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726391AbeJICDm (ORCPT ); Mon, 8 Oct 2018 22:03:42 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (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 83995214DA; Mon, 8 Oct 2018 18:50:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539024635; bh=upLm+mo08S7ILHAjdRv8ODefobKvsA20ykdFH5SKyG0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bQnsgRLEbV4B0lPDOdOnf7V3lS9lfY4OlAYaUxaOkFuzl4cEgcYTO0gaoQwqtzy/4 4j5w9xgNnhpjEcos5EI5+p2CDeO+Am6CMeqkQ1XL32L9qYVzcQNEBTA5tO87/GXczf LbGOyRqYGTZJ5b0uQkJ4zu2+WEbsReL04Jxinsn4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Somnath Kotur , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.18 104/168] bnxt_re: Fix couple of memory leaks that could lead to IOMMU call traces Date: Mon, 8 Oct 2018 20:31:24 +0200 Message-Id: <20181008175624.009943231@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181008175620.043587728@linuxfoundation.org> References: <20181008175620.043587728@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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Somnath Kotur [ Upstream commit f40f299bbe806a2e2c8b0d7cdda822fa3bdd171b ] 1. DMA-able memory allocated for Shadow QP was not being freed. 2. bnxt_qplib_alloc_qp_hdr_buf() had a bug wherein the SQ pointer was erroneously pointing to the RQ. But since the corresponding free_qp_hdr_buf() was correct, memory being free was less than what was allocated. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Signed-off-by: Somnath Kotur Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 2 ++ drivers/infiniband/hw/bnxt_re/qplib_fp.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c @@ -844,6 +844,8 @@ int bnxt_re_destroy_qp(struct ib_qp *ib_ "Failed to destroy Shadow QP"); return rc; } + bnxt_qplib_free_qp_res(&rdev->qplib_res, + &rdev->qp1_sqp->qplib_qp); mutex_lock(&rdev->qp_lock); list_del(&rdev->qp1_sqp->list); atomic_dec(&rdev->qp_count); --- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c @@ -196,7 +196,7 @@ static int bnxt_qplib_alloc_qp_hdr_buf(s struct bnxt_qplib_qp *qp) { struct bnxt_qplib_q *rq = &qp->rq; - struct bnxt_qplib_q *sq = &qp->rq; + struct bnxt_qplib_q *sq = &qp->sq; int rc = 0; if (qp->sq_hdr_buf_size && sq->hwq.max_elements) {