Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp485447ybl; Tue, 28 Jan 2020 06:41:54 -0800 (PST) X-Google-Smtp-Source: APXvYqw2W8fDHbhtDWtMPWpSLGlZ4rwKKQ3vAvWo+FcnVNSz9T++V5og95us4LCz553zoy2StJ7r X-Received: by 2002:a9d:6c06:: with SMTP id f6mr17075884otq.318.1580222513993; Tue, 28 Jan 2020 06:41:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580222513; cv=none; d=google.com; s=arc-20160816; b=JpXZVd0ubQgiSE2LNnP+o8/I4ivKe24dP5JRHPrMDdosyUWXZ7Jh22NonHIbbhDdnf haoPSbU/4UqXAJrW7IGx8u8aX/XuKXDjwOY3qjodL6pe19pVXb/mat2NzSeeInwROAiU Q8CPjh1BL9KpfdNaXE6m61VIJg8uEEH2SqUulVeNsh4nxUvSwXHvql8kKg9qtt+ok+Nx NKZIlwuaWuk+5ng7HnSlC+zoohUI0pL7V5mdxIn92xKCGLItGZ9KZxf17/V7HSmlJ5TS l+zDJQ8jHDfmkv9vxD/duqAQNSPMRde+X/ECmrEcjzTlNkmoep18rPBHv/WMS46Luj39 1G0w== 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=P3b1rTfRim2IVuXxIfzOpL4RHlsVSR0xZ2Dk7uKaNKM=; b=Wqvp2TjsF9aohO5ZOFV1XG7rsXeO+wrlejdFNHer4FJYuEksiD0JHVfvF1X7765JBu 6LC9o2BT7sdUayQm9iynXOursDR675J6L+ZllJXFcVTJj75aXYvsWwRPHyv2PuEcIqyf Zvmck3jTDF3dH3vA3zJWz+ziJa60h8whe4pih2jls7w6wZfVwvbzLIxyZ+SMI8LuwWG7 auOZhFdo6LcTYJ5gAExIpSRMLM1GpVAL8Hhxb3rB+06J77h1kTQL0YVH0GfbnIXOZKdB m1vUW09rwoeCAQjqJQsLY8kHaJu6MrJQHXssXnLIaEz0nIbCKalUHzAYcKJ7Dj0HPFZm j6MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FYuEQJuM; 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 v141si4647458oif.161.2020.01.28.06.41.41; Tue, 28 Jan 2020 06:41:53 -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=FYuEQJuM; 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 S1726651AbgA1OQE (ORCPT + 99 others); Tue, 28 Jan 2020 09:16:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:38980 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728288AbgA1OQA (ORCPT ); Tue, 28 Jan 2020 09:16:00 -0500 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 97E2C2070E; Tue, 28 Jan 2020 14:15:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580220960; bh=k42k9eZ689CMV2xeZOWs6oYMcM72Q1PFKosBAwUTQks=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FYuEQJuMTnelX8eg35mdoijArjS1R4Ivi0Co8tMCZxXMt55Ag69/NCAIS145NPOyY YsP1YS9KcTqqWmGGbGXFuqIeRAPX7X8uFXIvrxhH1gWwWo2QyH8Ybki6L/ZZjjdDl2 0alWrOSvx5B9jfr0p26zACzG9WTAnD+m7vl9u7dE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Leon Romanovsky , Zhu Yanjun , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.9 007/271] IB/rxe: replace kvfree with vfree Date: Tue, 28 Jan 2020 15:02:36 +0100 Message-Id: <20200128135852.927959741@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@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: Zhu Yanjun [ Upstream commit 721ad7e643f7002efa398838693f90284ea216d1 ] The buf is allocated by vmalloc_user in the function rxe_queue_init. So it is better to free it by vfree. Fixes: 8700e3e7c485 ("Soft RoCE driver") Reviewed-by: Leon Romanovsky Signed-off-by: Zhu Yanjun Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/sw/rxe/rxe_cq.c | 4 ++-- drivers/infiniband/sw/rxe/rxe_qp.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_cq.c b/drivers/infiniband/sw/rxe/rxe_cq.c index e5e6a5e7dee9c..5ac88412f1ffe 100644 --- a/drivers/infiniband/sw/rxe/rxe_cq.c +++ b/drivers/infiniband/sw/rxe/rxe_cq.c @@ -30,7 +30,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - +#include #include "rxe.h" #include "rxe_loc.h" #include "rxe_queue.h" @@ -89,7 +89,7 @@ int rxe_cq_from_init(struct rxe_dev *rxe, struct rxe_cq *cq, int cqe, err = do_mmap_info(rxe, udata, false, context, cq->queue->buf, cq->queue->buf_size, &cq->queue->ip); if (err) { - kvfree(cq->queue->buf); + vfree(cq->queue->buf); kfree(cq->queue); return err; } diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c index 44b2108253bd9..d6672127808b7 100644 --- a/drivers/infiniband/sw/rxe/rxe_qp.c +++ b/drivers/infiniband/sw/rxe/rxe_qp.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "rxe.h" #include "rxe_loc.h" @@ -255,7 +256,7 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp, qp->sq.queue->buf_size, &qp->sq.queue->ip); if (err) { - kvfree(qp->sq.queue->buf); + vfree(qp->sq.queue->buf); kfree(qp->sq.queue); return err; } @@ -312,7 +313,7 @@ static int rxe_qp_init_resp(struct rxe_dev *rxe, struct rxe_qp *qp, qp->rq.queue->buf_size, &qp->rq.queue->ip); if (err) { - kvfree(qp->rq.queue->buf); + vfree(qp->rq.queue->buf); kfree(qp->rq.queue); return err; } -- 2.20.1