Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3304671pxk; Mon, 21 Sep 2020 10:08:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycHv0XEOrX5mATtIzS2Cb51z9dN23eo+OE2iByF8r3rfJouckttdcWdcGWhYbdJiIYI0OY X-Received: by 2002:a05:6402:b64:: with SMTP id cb4mr654001edb.25.1600708127145; Mon, 21 Sep 2020 10:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600708127; cv=none; d=google.com; s=arc-20160816; b=w+a5j5IDPaReqKTURXIbZSx9roG2TYfUPr2zqGIyHo4QTn/szyyUO75CaTk0sPd7wk o2OocqWvqX/g+UfCypRGsferGgDsh4x5zHYmstxcoDh8Z1oFEbwxvLn5Skcd3vChlLrQ nhn8IbbXU/KbTkVxLKIbuq3QV4/VTEzex0M4y4XgYGLYaO6VXk9fzhAy9mJI7dnFVuAo 51te/eKGHEyf/tZNm1VzIlX0q99ax92kGP7cso9y5l72AAsic3UeY5aTcHYg45NCmJXK hJ+ajchEUOnwSW4qfkrpcJLEY9enXjUf0Ijeewpo0dw7WOQYfdvszjTStm3f0jpogI10 9S8g== 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=9n5PUi6Q3n+ibdhYn4Jt+u6rz7h9pkZnIAbkrfDwa18=; b=Sy+JLUjEykcFTM/Sxf3OLQ3K7iiH3sjAxKEl9+uHC8g+hwFcLL6W4nMzfe6JHvpLag /PKFZiILNZL4J2/h7UUMdtCtcIFyWjhPVjkykUpI9dEMkExMKDDpZOGKx7EMtBZOhPAW pWjr9jIr7Qc0AmrwUZgmA5eAyNMPhqfnnAQtRH4eN9pZEkkfRe7MpmaROuS8ecuX/CmN TYVrXf6rerk0JkSnS8YQIwmqs9gMnAv/4H7xQMBjAniLWhYiBgmDYyi2fdviUoxCZ2vg 5Q5hiiJSlZgjKkaPkuFas8SjJgf+jDVMLB+DypE3aMFh08hH9uMKx52Jy65mrdW7NTGR PIlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=P9UaIYmm; 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 wn10si8577974ejb.19.2020.09.21.10.08.23; Mon, 21 Sep 2020 10:08:47 -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=P9UaIYmm; 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 S1729588AbgIURFY (ORCPT + 99 others); Mon, 21 Sep 2020 13:05:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:60792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728311AbgIUQeJ (ORCPT ); Mon, 21 Sep 2020 12:34:09 -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 AB68E239D0; Mon, 21 Sep 2020 16:34:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706049; bh=P74bg1oxvriKc+IHNTu/YL9uDoN4V/68SHrFiH+Bd4g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P9UaIYmmcCxdA/Yaz72r2HnmRXVhIv/XBj2Tk8mprNeVrUqPr/ckyxkGTqimtGq19 z1SqwJH+bpuCLvfGwS0zjPbS7OBcSOejZyj1WLLiuyIIPetub5jxt3vXeIHLJU7SEB /VXmvXIWknfmyfNAIE3MOIgzfGX4jC8RX1GL+qrM= 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.9 02/70] RDMA/rxe: Fix memleak in rxe_mem_init_user Date: Mon, 21 Sep 2020 18:27:02 +0200 Message-Id: <20200921162035.247677847@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162035.136047591@linuxfoundation.org> References: <20200921162035.136047591@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 9b732c5f89e16..6d1ba75398a1a 100644 --- a/drivers/infiniband/sw/rxe/rxe_mr.c +++ b/drivers/infiniband/sw/rxe/rxe_mr.c @@ -205,6 +205,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