Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp30173pxk; Tue, 15 Sep 2020 16:53:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwakwpF7JCDjDTERwyniJwqtAorFGF8pFLD/BkDs3JGhMhJ7h0O/PqKQNvaYdqsf6+AXibq X-Received: by 2002:a17:906:f1cf:: with SMTP id gx15mr22169668ejb.241.1600213998936; Tue, 15 Sep 2020 16:53:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600213998; cv=none; d=google.com; s=arc-20160816; b=thXEtnM6uqZejT+eo9C9e0CjWfXE/26JVzg/CzN1IQf2TK6xRvltfznTK4Fw4iA0C8 s7f09LAHn2xXoPfhX7WRoiKiiAd8JUn8nRn+vTc0N+T+JfVm8KE+4EflFslue8PeJyXC b0unmb3zNE7B9qZvRqQmtWimJMCGawV9+TVvD5KT6VxZr5Lo4OOs48CpcvGd17otNglZ 39Ga0G8i403KAFztxda+h4SrHGc01Uc8r37plNwhgJNC4+RqaTvCOP5UqbPtMv4jwlb8 Ql3Cv/5nXFTxjpHGpwKb1rf4ocuDKiCPGaKe00zhJSIfkQ1qCxS3sQs1XhBEY8g8HD0d 25fA== 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=aj6RDPPFbla2t+WPdNdQ+jkW9yzHCzwQmBayinE40YU=; b=nyAoeiudxohcE+rw+OJnEKwum4QRqjl8gEBYR+PSHe58/CC/akGr+UiDQj9xYvOw09 3CjBGfWBdoDTxgAgnaTdDOKmXiYO//0g3d5f11q9OxgXcN9e4EARFfaPZI7r1P+9e8/0 Q1uoriDIP58MOOfC7tb1IYgbyChUH3IVDav6faE479ZzwEu2Tizx7MLLpDGPPaXB2f6g bSBuM0s+BOuayZwYa+NE2pg0EzsaL73XQQDbH1rwWd3b2zwEr9Ndgfb2F9NVEr8lNrTv dVHZd+/yYX4R7u6ysyW2pLthMM9vCy9kAFdPOIrbINW5L9X6cHjgoygCMIXHlINPlAU9 +obg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qwSluy9Z; 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 lt3si10232896ejb.687.2020.09.15.16.52.56; Tue, 15 Sep 2020 16:53:18 -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=qwSluy9Z; 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 S1727207AbgIOXuD (ORCPT + 99 others); Tue, 15 Sep 2020 19:50:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:44122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727093AbgIOOcm (ORCPT ); Tue, 15 Sep 2020 10:32:42 -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 10D8723BCD; Tue, 15 Sep 2020 14:24:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600179861; bh=mGYM22SuLBLeqxtZ/AoDeKzHOnWQecWB71KGhDY2e5Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qwSluy9ZRnW353EoE6C1AifLlThLvmVGcTA6uqLm0OMWx178p28YCzhK5/w3ieKFm r18U6gS9mS0mpdoWZR9tOd9zUvkRamZthm2auQSBWhcfluEjhv0CC8P9CfUePmicMw IA3Ole6yomPgAZoQwVWhiBbSEFZwwY50fcRjm4Xs= 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 5.8 015/177] RDMA/rxe: Fix memleak in rxe_mem_init_user Date: Tue, 15 Sep 2020 16:11:26 +0200 Message-Id: <20200915140654.373655720@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200915140653.610388773@linuxfoundation.org> References: <20200915140653.610388773@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: 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 e83c7b518bfa2..bfb96a0d071bb 100644 --- a/drivers/infiniband/sw/rxe/rxe_mr.c +++ b/drivers/infiniband/sw/rxe/rxe_mr.c @@ -207,6 +207,7 @@ int rxe_mem_init_user(struct rxe_pd *pd, u64 start, vaddr = page_address(sg_page_iter_page(&sg_iter)); if (!vaddr) { pr_warn("null vaddr\n"); + ib_umem_release(umem); err = -ENOMEM; goto err1; } -- 2.25.1