From patchwork Sat Nov 26 09:44:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13056404 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 41E5BC4332F for ; Sat, 26 Nov 2022 09:45:52 +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: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:In-Reply-To:References: List-Owner; bh=ruNup+aVtDCmkXVhAsrqoUalw7vEsrVB3b0MJ3Xfv3U=; b=qFyLCZpbb3sm3Y lSUpHFwRCnxjq1PAGoYHjYjKAxEtIHaLgeHvn8NY7A91R4nBkng7X0lkaqyhV4u+JRHonRkAwD6as 3JK1jzrGwSTyWrrxTdVT/lkDTxOrCY1FYM3DJuVcm9i+uUz2Bg3Ng4IVomXoKi5Enk8cJKfOnG6oh SypRVgtY9xvMPN9mLJDAhjpTO8Z2P8rqItS93mzE1tQzQUwuqmYkPGGIVc/qObhAnA2HN31Po5yfI X9YM9LBR2f39d2zjhDuyVoE1DAB+lph+yBNpFkICGqukUf9r5Fq6fjVNKs0lfSCFBDOcdz3yl6uPP dKz3CTPP9Ix4DfGa2UQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyrjS-005Lyn-On; Sat, 26 Nov 2022 09:44:22 +0000 Received: from smtp-25.smtpout.orange.fr ([80.12.242.25] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyrjN-005LvB-1m for linux-arm-kernel@lists.infradead.org; Sat, 26 Nov 2022 09:44:20 +0000 Received: from pop-os.home ([86.243.100.34]) by smtp.orange.fr with ESMTPA id yrj9oK7dJ5FWAyrj9ogvye; Sat, 26 Nov 2022 10:44:08 +0100 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 26 Nov 2022 10:44:08 +0100 X-ME-IP: 86.243.100.34 From: Christophe JAILLET To: Jeremy Kerr , Joel Stanley , Alistar Popple , Eddie James , Andrew Jeffery , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-fsi@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org Subject: [PATCH] fsi: Aspeed: Fix a resource leak in fsi_master_aspeed_remove() Date: Sat, 26 Nov 2022 10:44:02 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221126_014417_262839_4B01C361 X-CRM114-Status: UNSURE ( 9.83 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org An explicit get_device() call in fsi_master_aspeed_probe() is not balanced by a corresponding put_device() in the .remove() function. Add it, otherwise some resource may never be released. Fixes: 606397d67f41 ("fsi: Add ast2600 master driver") Signed-off-by: Christophe JAILLET --- This patch is speculative and untested. --- drivers/fsi/fsi-master-aspeed.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c index 7cec1772820d..b66d9853117b 100644 --- a/drivers/fsi/fsi-master-aspeed.c +++ b/drivers/fsi/fsi-master-aspeed.c @@ -651,6 +651,8 @@ static int fsi_master_aspeed_remove(struct platform_device *pdev) fsi_master_unregister(&aspeed->master); clk_disable_unprepare(aspeed->clk); + put_device(&aspeed->master.dev); + return 0; }