From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932855AbbJMR07 (ORCPT ); Tue, 13 Oct 2015 13:26:59 -0400 Received: from mga14.intel.com ([192.55.52.115]:64804 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932450AbbJMR05 (ORCPT ); Tue, 13 Oct 2015 13:26:57 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,679,1437462000"; d="scan'208";a="825800341" Subject: Re: [PATCH] misc: mic: fix memory leak From: Sudeep Dutt To: Sudip Mukherjee Cc: Sudeep Dutt , Greg Kroah-Hartman , linux-kernel@vger.kernel.org In-Reply-To: <20151013171559.GA6720@sudip-pc> References: <1444727291-4681-1-git-send-email-sudipm.mukherjee@gmail.com> <1444754061.93285.246.camel@localhost> <20151013171559.GA6720@sudip-pc> Content-Type: text/plain; charset="UTF-8" Date: Tue, 13 Oct 2015 10:25:20 -0700 Message-ID: <1444757120.93285.268.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 (2.28.3-30.el6) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2015-10-13 at 22:46 +0530, Sudip Mukherjee wrote: > On Tue, Oct 13, 2015 at 09:34:21AM -0700, Sudeep Dutt wrote: > > On Tue, 2015-10-13 at 14:38 +0530, Sudip Mukherjee wrote: > > > > + struct scif_hw_dev *sdev = scifdev->sdev; > > > + > > > + dma_unmap_sg(&sdev->dev, p2p->ppi_sg[SCIF_PPI_MMIO], > > > + p2p->sg_nentries[SCIF_PPI_MMIO], DMA_BIDIRECTIONAL); > > > > Hi Sudip, > > > > You missed unmapping the aperture here: > > > > dma_unmap_sg(&sdev->dev, p2p->ppi_sg[SCIF_PPI_APER], > > p2p->sg_nentries[SCIF_PPI_APER], DMA_BIDIRECTIONAL); > > > > Can you please resubmit this patch with the change above? > > Hi Sudeep, > v3 sent for your review. > > > > Also you should mention [PATCH char-misc-next] in the next revision. > > Ohhh... yes, I keep forgetting that Fengguang will need this tag for > his build bot. > > But I have one more doubt. If scif_nodeqp_send() fails then shouldn't we > remove these two nodes of the p2p connection from the lists and release > the resources? The resources will get cleaned up via scif_destroy_p2p(..) once they are added to the lists. Sudeep Dutt