From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7392C433FF for ; Thu, 8 Aug 2019 12:29:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 773522171F for ; Thu, 8 Aug 2019 12:29:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="W4pOL1Mo"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="rQ2IIjOd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 773522171F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LOecogmB979+Ja16Unjp9Tm4lUZpyi7R2KmUN35qCtc=; b=W4pOL1MoMoAoC2 parUu2vzHX6o96jFQHMw55H3NYlAoFOPvzOSiOT7azZRveOFoZhaCh35aAu3GWxuavQGO5+g7PZZQ bc8SA44ylg7AiTYDGJy7c2CUUlbeiuSCTMk1pN068iYZH5QchUkKt86v3p3y/rshGCBRusP20amv2 hyaCH8BunjBpKjnbPlxs555LcqpHdHCqmeyHN2/T5++Td0Fr9j6L6VTFobFhCiFwKLthlYE1GBl/o 8FML1/m2GgDUOPgxeaerq39QAhPr3opEIcGw8iwjuAMrosbrBz6txyADEHe4TCLH9NQIz4afKdZtg 8lFovuqVm3kODeZ/N7hg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hvhXc-00023B-3W; Thu, 08 Aug 2019 12:29:12 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hvhXY-00022m-Od for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2019 12:29:09 +0000 Received: from localhost (unknown [122.178.245.201]) (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 B339C204EC; Thu, 8 Aug 2019 12:29:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565267348; bh=6jzux0+2vvckRewHmMdUXtSlDgM4FNrOY4r8OF3oAc4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rQ2IIjOdyPZYz8p/n9UOdJfzjP5Ie4l9sLrtdN1AbNjOBzXz6Uv6nztj9w/rA+zxe CZ5C1s2KkedVvmuGExd9Yj8FSPfYWe+w9BYnxy3qUB3lWuXMqnDMmTyWp6PeqwJyQk CtOVSp1HQ0KTpZlA6coKRkcdIXsC9slMOaPApKQI= Date: Thu, 8 Aug 2019 17:57:56 +0530 From: Vinod Koul To: Sinan Kaya Subject: Re: [PATCH v2] dma: qcom: hidma_mgmt: Add of_node_put() before goto Message-ID: <20190808122756.GS12733@vkoul-mobl.Dlink> References: <20190724081609.9724-1-nishkadg.linux@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190808_052908_825126_CB0F485B X-CRM114-Status: GOOD ( 13.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, agross@kernel.org, Nishka Dasgupta , dmaengine@vger.kernel.org, dan.j.williams@intel.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 24-07-19, 13:25, Sinan Kaya wrote: > On 7/24/2019 4:16 AM, Nishka Dasgupta wrote: > > Each iteration of for_each_available_child_of_node puts the previous > > node, but in the case of a goto from the middle of the loop, there is > > no put, thus causing a memory leak. > > Hence add an of_node_put under the label that the gotos point to. > > In order to avoid decrementing an already-decremented refcount, copy the > > original contents of the label (including the return statement) to just > > above the label, so that the code under the label is executed only when > > a goto exit from the loop occurs. > > Additionally, remove an unnecessary get/put pair from the loop, as the > > loop itself already keeps track of refcount. > > Issue found with Coccinelle. > > > > Signed-off-by: Nishka Dasgupta > > nit: please post v3 with dmaengine:qcom:hidma_mgmt:.... > > Vinod doesn't like commit subjectss in this directory to have dma name > on it. You can keep my acked-by. That's right but I am okay to hand edit while applying for drive by contributors :) so applied with you ack > Acked-by: Sinan Kaya > -- ~Vinod _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel