Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp853997pxb; Tue, 14 Sep 2021 10:06:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+m0s3GFD3zPGNZqMvTjo9nW/uyPqJaKzuLhoreT+/XN6gLUA8/K4r9u0SaLBm443qypuy X-Received: by 2002:a2e:90d6:: with SMTP id o22mr16602110ljg.366.1631639203786; Tue, 14 Sep 2021 10:06:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631639203; cv=none; d=google.com; s=arc-20160816; b=gY4f7Oev/+2RgY5fUi3ViCC/5fQgrr1o3XYkR2+ChewVybe6zD898ztOHl3S/EJx50 Lgs1ncnRjjn2o4JRFayD8X5z2t3SNeYotIZKX1P6P5GfK+GV9FTE+OWkB0/xVyyAE3uU 3U4+ltRBobMB24ulD8uxG4N6Cizu3mSVqjYP1WsMLcMKIuNVr7nCNw0UrDEGcMp70KpF w3DwJ5IHRN91Zo1b4O+Mnc6Cpx450lKeiBm1TIky3M3spk4l+591+ZpRvmP+rnjWXunJ KQiPOPcht3jxHd0vL5sfZFRaSJ0V7UzyfEX4r2B6wAgfG0Rwl3OC1EfLpZEoztF468vw eCXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=8D3vfI5wbGikQ9VmghVEoumvDe5NmCL4K+Zm2LYuBiE=; b=mW+W2IT+4ElfRsNGZaJkEdPi8dgjSB+xfd4Ys26/4aNhVizZnv1y4Pwcanfu2AH+So QkheYDeYblMi22zaXAv/MgRqHy7zkrXos5cmTqS9IUNr4a3KYL456WUO76uZBIe7p+nx Cj2v9tN3tDsfeaKllc5ENXl0mxeWl3ss8C8ZJ0J0NMu91y+jMbzPDOuB89AYfWQJ/mDZ 3lt54lW6SdhAzB9ujjRSkD73NSt8nfYJeDSBREpyL4sC9yLNuUT4ks+fjlrE7PlXSCIe TzZBcUiSQERXYzVPpqBe9umI9U9x79kqFWZwbjZfJ7gp1/fFEJ39zRkV77EagnRTd7GX LL9A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e14si13391082lfr.66.2021.09.14.10.06.02; Tue, 14 Sep 2021 10:06:43 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbhINRDS convert rfc822-to-8bit (ORCPT + 99 others); Tue, 14 Sep 2021 13:03:18 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:57911 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229612AbhINRDR (ORCPT ); Tue, 14 Sep 2021 13:03:17 -0400 Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 2FD0B40008; Tue, 14 Sep 2021 17:01:57 +0000 (UTC) Date: Tue, 14 Sep 2021 19:01:56 +0200 From: Miquel Raynal To: Xin Xiong Cc: Richard Weinberger , Vignesh Raghavendra , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, yuanxzhang@fudan.edu.cn, Xiyu Yang , Xin Tan Subject: Re: [PATCH] drivers/mtd/nand: fix reference count leaks in ebu_nand_probe Message-ID: <20210914190156.56509462@xps13> In-Reply-To: <20210910165316.2500-1-xiongx18@fudan.edu.cn> References: <20210910165316.2500-1-xiongx18@fudan.edu.cn> Organization: Bootlin X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, xiongx18@fudan.edu.cn wrote on Sat, 11 Sep 2021 00:53:16 +0800: > The reference counting issue happens in several error handling paths > on two refcounted object related to the "ebu_host" object (dma_tx, > dma_rx). In these paths, the function forgets to balance one or both > objects' reference count. For example, when request dma tx chan fails, > the function forgets to decrease the refcount of "ebu_host->dma_rx" > increased by dma_request_chan(), causing refcount leaks. What's more, > the "ebu_host->clk" object also need to be handled correctly. > > Fix this issue by keeping the return value and jumping to > "err_cleanup_dma" label. I think it has already been fixed upstream: 0792ec82175e ("mtd: rawnand: intel: Fix error handling in probe") Thanks, Miquèl