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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A0B7EC433EF for ; Mon, 14 Mar 2022 16:02:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cApgzRMPyWGbXbn4NpxuIed7U/BNCXfAQsiF6NbLLgc=; b=AM6CupjoiwwKZS 0562uS1HCGvnlIfdHph8jsjlYtDIRr/YR1OZUWomL6QtE79b4SfOv6zZsB1W3Izc1ke2HlAEiM+Zy wfQ1gdwdVQUaRlBk/NFBg5quabnUBYr6vwPsH27zbBqaL+6cu8HtKblaMMhyHKr0EacBsWYOvoe/n 6GZ6kim60Ijye1hM4+yhv5FglMEJeaRQGhGNJSkCHQUBZDdioozCRS1Abdsrl5o5bt3uR/GaLQ6Li OfmM8s38xg23wdSYQqILMc41T1IvNlSptRwXHIQHG0/qb1Axq6GmXvQPBWqCMvgLaAJ2gGwq8k2M/ Z00uj5QfRHvljb2wLtAw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nTn8D-005ukd-P2; Mon, 14 Mar 2022 16:01:13 +0000 Received: from relay12.mail.gandi.net ([2001:4b98:dc4:8::232]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nTn7D-005uML-M5; Mon, 14 Mar 2022 16:00:13 +0000 Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 1C66E200007; Mon, 14 Mar 2022 16:00:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1647273609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RcTeCSqjA30WWQNMW0gHvtlkhVvj5befvu9dAIyBttU=; b=B3nDZWQVGuyP1Y3ap+c4EWjrDmdWvX8VY3+6+D+TakX+BJqXi+ruTobaxoPh89pSmzaNH0 HRhifMCrSb86dmLoektCYPhJ4Dm3i4NxrjRTtCMhs9zXjIMk9vM4ewaUyU1kAAvxj0au5M 5rbUeel2PKMPi4nYXEWbdDg6yXQjmrPzsZxN5MGGFwKsldw08gg7azlJqupljA3dFTiLuD ryvwCRz4cxxzg5ipzsfitngFji5p1b9ilNDjmsMhf9AjLsTFKRM+0rSYCpwSUTtVo3/13h dfdOOE9Y8ps4LSPsSnB+AwFR7/1ejT/q8S4LmQwEU2xATS+nCGBSgg9BGIDczg== From: Miquel Raynal To: Xin Xiong , Tudor Ambarus , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Boris Brezillon , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: yuanxzhang@fudan.edu.cn, Xiyu Yang , Xin Tan Subject: Re: [PATCH v4] mtd: rawnand: atmel: fix refcount issue in atmel_nand_controller_init Date: Mon, 14 Mar 2022 17:00:00 +0100 Message-Id: <20220314160000.77465-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220304085330.3610-1-xiongx18@fudan.edu.cn> References: MIME-Version: 1.0 X-linux-mtd-patch-notification: thanks X-linux-mtd-patch-commit: b'fecbd4a317c95d73c849648c406bcf1b6a0ec1cf' X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220314_090011_910637_5E6AE064 X-CRM114-Status: UNSURE ( 6.60 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 2022-03-04 at 08:53:32 UTC, Xin Xiong wrote: > The reference counting issue happens in several error handling paths > on a refcounted object "nc->dmac". In these paths, the function simply > returns the error code, forgetting to balance the reference count of > "nc->dmac", increased earlier by dma_request_channel(), which may > cause refcount leaks. > > Fix it by decrementing the refcount of specific object in those error > paths. > > Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver") > Co-developed-by: Xiyu Yang > Signed-off-by: Xiyu Yang > Co-developed-by: Xin Tan > Signed-off-by: Xin Tan > Signed-off-by: Xin Xiong > Reviewed-by: Claudiu Beznea Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks. Miquel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel