Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp59859pxb; Mon, 31 Jan 2022 15:12:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJy4iaIqUuUQfIhYDiust13BWJ8/g2fK0AL7gvzmu9/JMPRo76R7a9mtdfRCEK9pDs6HE8hP X-Received: by 2002:a17:90a:3e49:: with SMTP id t9mr26845447pjm.163.1643670747257; Mon, 31 Jan 2022 15:12:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643670747; cv=none; d=google.com; s=arc-20160816; b=UvlkXsSXZBQ6dEd+GhPIqiqrSfOs0wDnb28FWEcQ4w4XQ6HFvQYJbfQt/qpzpJsLBN SIUkUIBB/yjO24LrQFKcaG3wGlUbQdI4HrWQF44fN2/9TuMZUaJsQLlEDBbIaDruKa1R BO47LPcN+R2AfQpXvXKISKbzcURkd0hYChyArehIoyFzlUGLr96nDfSZda+7S3OMjCFj gfvTtietiw1DyimaggBr5wYaYW9dO9+dJ0PGAGGzmbZ3fZgFcmFyLAKg6QISTogeuiGp 8WPi7TNdf4PH7ZFvrjs+lpVHyDxxuYyrep96MSmrxf0b0hs3hVJxMGxRON95Ng8/jKh+ kPGA== 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 :message-id:date:subject:cc:to:from; bh=dnY7UB+wgfwVL3wGgtPPSeM17c4EZIyZlzZOQkiFcYs=; b=oJbaXgZlcMqNFn4tozKaPMHoDtMy4SWxPZo5JIAlLMqA/8l5WtlDTLWpUEkVPngAvj aI+oJME/gXSHAYC97BRWf3JnPgVmYMsw23/1o7dhhqeD9j+7Hhv7LM5Qch2ZYksVTZny 2WojtPo5VD2xy1QSynAyMdRkeT1PFsEjWe2lMq653LRU3voLhsqv3gP4QxfdhGKo/02+ tBDkyt5gEIHXDafYgDk0dsuYvolZkYNgzSE7GPd/6v3PeIopcNN3OvfUBXUPcneOXqap rys7LAvPuoBxge3eGI5amuZhhlJC43DCuD+AvmqmyL9MBChID5NgFWv9Z4BqkaGUfwK7 Wxdg== 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 d191si14413492pgc.412.2022.01.31.15.12.15; Mon, 31 Jan 2022 15:12:27 -0800 (PST) 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 S1350673AbiA2HQU (ORCPT + 99 others); Sat, 29 Jan 2022 02:16:20 -0500 Received: from smtp02.smtpout.orange.fr ([80.12.242.124]:52961 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350164AbiA2HQT (ORCPT ); Sat, 29 Jan 2022 02:16:19 -0500 Received: from pop-os.home ([90.126.236.122]) by smtp.orange.fr with ESMTPA id DhxynhQx2eHnVDhxznuAOZ; Sat, 29 Jan 2022 08:16:16 +0100 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Sat, 29 Jan 2022 08:16:16 +0100 X-ME-IP: 90.126.236.122 From: Christophe JAILLET To: Anatolij Gustschin , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Grant Likely , John Bonesio Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linuxppc-dev@lists.ozlabs.org Subject: [PATCH] powerpc: platforms: 52xx: Fix a resource leak in an error handling path Date: Sat, 29 Jan 2022 08:16:04 +0100 Message-Id: X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The error handling path of mpc52xx_lpbfifo_probe() and a request_irq() is not balanced by a corresponding free_irq(). Add the missing call, as already done in the remove function. Fixes: 3c9059d79f5e ("powerpc/5200: add LocalPlus bus FIFO device driver") Signed-off-by: Christophe JAILLET --- Another strange thing is that the remove function has: /* Release the bestcomm transmit task */ free_irq(bcom_get_task_irq(lpbfifo.bcom_tx_task), &lpbfifo); but I've not been able to find a corresponding request_irq(). Is it dead code? Is there something missing in the probe? (...Is it working?...) --- arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c b/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c index b91ebebd9ff2..e0049b7df212 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c @@ -530,6 +530,7 @@ static int mpc52xx_lpbfifo_probe(struct platform_device *op) err_bcom_rx_irq: bcom_gen_bd_rx_release(lpbfifo.bcom_rx_task); err_bcom_rx: + free_irq(lpbfifo.irq, &lpbfifo); err_irq: iounmap(lpbfifo.regs); lpbfifo.regs = NULL; -- 2.32.0