Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3285591pxk; Mon, 21 Sep 2020 09:41:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVU8Kf1J107TsRHwyTAjq45UDc7MlFJwJ4oRCf+cFiP2RfIbJriHLnmYAT29aPVV6WBY80 X-Received: by 2002:a05:6402:1d03:: with SMTP id dg3mr502294edb.249.1600706517495; Mon, 21 Sep 2020 09:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600706517; cv=none; d=google.com; s=arc-20160816; b=RUMMdSR8CgeD8Cz+zJFxW1elzVs7YirvH1/6MMjID3efASlPVSzfQmLdP39vS0KLrF m/zDBmUvNnyHW2QixT1ZgfInoQ8UAFJtW2vrADZ6GkeBvmv1Moysd29S0aBmZ5LR4bBW KyRBNMEByKpr8H6fdEE6tXFCs/uq2FEXrPCpe3t9sGrmjpC3boE9WUv1k0/qZ8+4EILd JdLbAYpxtyYRMNvQdhASRYnpJpqvWtdrtixUtj3GHGcrx5kyrWhi2cRnGiaGDGJUKImP +MyoXUG0mkabBMHfEhNgeweqvjny/S4RA0AJ5wVpyi4zU/I/MFaITY9FN43dq6qkTFHI bYNQ== 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=1PRWa9K5P0tMdksMD3O/XM7Ht2Lv3CB/NwfUq9lnH78=; b=ILQHMIj0NF32D7xonkJSsLkRcy4SHiYAyRpjR9JW3Xk6xoZXs4S2O2ZTs5vVvnev2S mkBPqJvxvuDj/vMTj+vy5JQB2Z+GjEFi6JgDx/hRpMyN41DsQPq8Gkt7w0anfnjsEuUx XnFqv7hqSrsLvXzigYECdvuw9yHdj4q+og/An2pcn9VNJFsq8g1tfskuCcdNVEl6zN1Y M88EzRHzBPPEmixd5Xw3EAvqrlH1bSBXY7tzbiqGAKEcHD4H8B+3q3e2NiC8qlb0FQEz BZduxDXqcEShcKZPGuIU0pF7bsrsSZy8DdMJkGkGfUdOUJ9i6jCgzit88uF1ZSMmBZNz ZoYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="xxQJk1b/"; 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=fail (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 d21si9227388edp.276.2020.09.21.09.41.30; Mon, 21 Sep 2020 09:41:57 -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=@kernel.org header.s=default header.b="xxQJk1b/"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729047AbgIUQhV (ORCPT + 99 others); Mon, 21 Sep 2020 12:37:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:37540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728300AbgIUQhR (ORCPT ); Mon, 21 Sep 2020 12:37:17 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 33A40238E6; Mon, 21 Sep 2020 16:37:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706236; bh=QlXvnEx3gR+qHv3YvlrbAM27HUv4H3+mUytXmg86+r4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xxQJk1b/zDiByo5YZjmz/aQXY6wHYeJlorKKRq1XfPs18KjymE1zKh5lX1CZoQ+LS 8/ys+s5uAirO/ZLzrVAkCLesUBiTdjVdCWCI2efVHh4yk4mVpPoujLkMaRHplRQzcs SQpD3FDb3vQbb9iGbU7TW4ecmrF+OPTpIDKuXnIA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.14 02/94] RDMA/rxe: Fix memleak in rxe_mem_init_user Date: Mon, 21 Sep 2020 18:26:49 +0200 Message-Id: <20200921162035.664295298@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162035.541285330@linuxfoundation.org> References: <20200921162035.541285330@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: Dinghao Liu [ Upstream commit e3ddd6067ee62f6e76ebcf61ff08b2c729ae412b ] When page_address() fails, umem should be freed just like when rxe_mem_alloc() fails. Fixes: 8700e3e7c485 ("Soft RoCE driver") Link: https://lore.kernel.org/r/20200819075632.22285-1-dinghao.liu@zju.edu.cn Signed-off-by: Dinghao Liu Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/sw/rxe/rxe_mr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c index 5c2684bf430f8..a0d2a2350c7e5 100644 --- a/drivers/infiniband/sw/rxe/rxe_mr.c +++ b/drivers/infiniband/sw/rxe/rxe_mr.c @@ -203,6 +203,7 @@ int rxe_mem_init_user(struct rxe_dev *rxe, struct rxe_pd *pd, u64 start, vaddr = page_address(sg_page(sg)); if (!vaddr) { pr_warn("null vaddr\n"); + ib_umem_release(umem); err = -ENOMEM; goto err1; } -- 2.25.1