Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp26615pxk; Tue, 15 Sep 2020 16:46:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJws3oh5hzkNvTYvxdI0al/pPKQu9buS+C5y6A9jSuFjKxUsC0e7XuJlQfRFeUF3CK5Ggg/r X-Received: by 2002:a50:9d0a:: with SMTP id v10mr24508619ede.144.1600213584802; Tue, 15 Sep 2020 16:46:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600213584; cv=none; d=google.com; s=arc-20160816; b=USMfffV1K5xgMciOYi6oJbjkFLvTvC1yQ87GA/47bIk/3eQ0mOJ3pn8Q3dzZBmIRs2 SSf2vqedrhWir/lKtsVXMn1Qdru1vrDTQK7zw0mxnUgRD0cXbUgh+pSeV6UGfDWXcifw 45kZJ7lITsTrUxtqNITVSHjDuixw9D+Ptau9EZY4FnKp3h3VzPutUF/insGP0vtbQd0I 59Sv80feLQEv1DTA36DM3hVjpcdHIac2cI7Q4BHJ3I6o0C+UzHIWBM91SElNPQNMRNG0 Vrdj/38aw1sO7H37gn8Pdx7ydJOpnZVtLNb/uCKOhj+D/ez87v8IrIoDfeOKdB4KO+qT 4Ptg== 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=oKugO+Cj4f4gMbvWxQjxiodk9fa5YWeKHXqQXO7vzTw=; b=ulJRWiXa5f4170iaE3EF24uRQ/V+a/90MEqGLMcYoL9vxPOWxzPwzaa8xwaqgReHKF pk1QJKjFkGVFNy7WgqJVa67zl4fjTJHORgPAOSCNbekgXaCuW6C5q5J3PvCr5Y7cDgOc uQ2HvsT3D4oyKGOVxkm+J+Q9+Q6VaevhPnfm563VW3N7c5MrmTKIwR4srxKK0UsAA/zR qAMq1OvPPuun0tNuTWc0Z90SvFA8eE7/8iMROLT1aXN0TdyuYK0Vde1gypoxM4QYPoU5 NEakXqwr7nMLFZL1lseUw6t0ktVcri0yxwSLtcyGjhpeNgh/cNkWq0UwLtpbxGq7tSLw KVFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=scAlkz1O; 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 k10si10123506ejd.657.2020.09.15.16.46.02; Tue, 15 Sep 2020 16:46:24 -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=scAlkz1O; 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 S1727219AbgIOXm6 (ORCPT + 99 others); Tue, 15 Sep 2020 19:42:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:44144 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727084AbgIOOd4 (ORCPT ); Tue, 15 Sep 2020 10:33:56 -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 1C2AB2220E; Tue, 15 Sep 2020 14:16:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600179366; bh=GlC6sitWUz8lsGgGYG9CqFfSF0aw0BpNZsrM9Rwj3TI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=scAlkz1Op7RQqnI1qQKnxBqEIQ8Nb6C9lw9ucosu9wTa/K7XFOK1DpSRC6LqaTtpn NXUoSdUQVBF6Od7MpAqhbKuPj75saEHU+uDfhNqCKNsThBxPRJuCKZRUMnVKm86aw9 CGAFu4NmmK6c7v8Hjbk2JFeIvpBq7EsT62DrS7Ts= 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.19 05/78] RDMA/rxe: Fix memleak in rxe_mem_init_user Date: Tue, 15 Sep 2020 16:12:30 +0200 Message-Id: <20200915140633.799254311@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200915140633.552502750@linuxfoundation.org> References: <20200915140633.552502750@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 dff605fdf60fa..2cca89ca08cd4 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_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