Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2607462ybl; Mon, 19 Aug 2019 04:58:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqyitjO3N+zIQsTyEsZqCZkLcBG37g8ztA/H8sMEFDRW//oxWAt42NqPvAOMODEAkIdDRbO5 X-Received: by 2002:a17:90a:be07:: with SMTP id a7mr20152188pjs.88.1566215890899; Mon, 19 Aug 2019 04:58:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566215890; cv=none; d=google.com; s=arc-20160816; b=USeTiVFjp+/LJFbMh3KIRjbNiBRAJNg0ETMBeK9P0arZZtZM7oq/ELS9o1hNrPuvT3 J+2GMuAnAfKAFTSE97152E5X1bjd5GEawA/sgI4eOqn5i+Mr41022Mf2JZezRaY+7zLn IBUOEQiijGgYJnqvjaNo+cXyjJ0JduVLLMt594fZmu4rjpJ7T9iinseZDTykbPYVCw77 l2VzE2w4QzGhsRzO6fyqWjZeBWBw4emwK5Ymc+EwHDSTZ0jtcL5hxBLR3OPqal2LSkyY KLUBRA7zQfCLltNb92oQcoonI/QgnulAr2S7KlemuY/NtTBuibUrAjGWY6VnF3Aa84Bz IhhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=pVQTl1im7hHyqQzKfrUF2bqjcxLpe9M1LV0xmgc7g4A=; b=XODdhw7B+IfFVhYn5aNbxg97EiIT+fJ2d+FSbRvbCfx6/v032WS9fwhynpJFKex+Rd Rn0+1rBbVtr8sLbkhw9AT9d2Tc2MLOaOLxIJ0cal2yrpBJpMBxxossB6HyePS58Mgtkr vaixmlA4h04Wi887GwZfANnXr4/Oq4HXi3BGlBaEvteL5CgVaeyBduqTrN9gC1jYXr9e q8Czx/0PN+xNNDQcag68T/q8XDYKfGUuRBv+UbiePfL32VkJjhBGIPcyfBe6iUQdo9PF NIGI8CxJitfLl5hfhki78PEBNSTmqXKomwnbrfCIs6MlARYgQpN5M7PbhsAaCBs5pLO1 xPxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IUfGquRN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12si8770843pje.88.2019.08.19.04.57.56; Mon, 19 Aug 2019 04:58:10 -0700 (PDT) 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=IUfGquRN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727518AbfHSL42 (ORCPT + 99 others); Mon, 19 Aug 2019 07:56:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:43952 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726694AbfHSL42 (ORCPT ); Mon, 19 Aug 2019 07:56:28 -0400 Received: from localhost (unknown [77.137.115.125]) (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 CE12A2085A; Mon, 19 Aug 2019 11:56:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566215787; bh=NXxRgWsLB6Z8bxfZp+XAAmb3N7hJ6+RLVZk0B7dP0L0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IUfGquRNpepHtZHGBhZvfqZGaXBrbdUaBhK/xO7DWYKE6YDB6tGYLKK8MrdF85S9N n9b26O7v9+ELwVhdQMeGBjxDsJ8Qj6lBQZQbybmgVW7ut/ef8Lc9ANTlIZ9MNXhUb0 MFlCR3C973mSa3WcV33j2cf7gvROKZ9cSbFpa2IQ= Date: Mon, 19 Aug 2019 14:56:23 +0300 From: Leon Romanovsky To: Wenwen Wang Cc: Yishai Hadas , Doug Ledford , Jason Gunthorpe , "open list:MELLANOX MLX4 IB driver" , open list Subject: Re: [PATCH] IB/mlx4: Fix memory leaks Message-ID: <20190819115623.GD4459@mtr-leonro.mtl.com> References: <1566159781-4642-1-git-send-email-wenwen@cs.uga.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1566159781-4642-1-git-send-email-wenwen@cs.uga.edu> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 18, 2019 at 03:23:01PM -0500, Wenwen Wang wrote: > In mlx4_ib_alloc_pv_bufs(), 'tun_qp->tx_ring' is allocated through > kcalloc(). However, it is not always deallocated in the following execution > if an error occurs, leading to memory leaks. To fix this issue, free > 'tun_qp->tx_ring' whenever an error occurs. > > Signed-off-by: Wenwen Wang > --- > drivers/infiniband/hw/mlx4/mad.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > Thanks, Acked-by: Leon Romanovsky