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: 26198 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4547724wrr; Sat, 26 Nov 2022 01:49:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf50SUNW1PrHRrwycjxe8oU46AijMfvJJw5SKluy4AP8n829XrJkVnLrgTTcw/OOYdVitWcp X-Received: by 2002:aa7:cb49:0:b0:468:f307:3014 with SMTP id w9-20020aa7cb49000000b00468f3073014mr31096749edt.321.1669456165581; Sat, 26 Nov 2022 01:49:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669456165; cv=none; d=google.com; s=arc-20160816; b=kDKyYcx+D6qOcbpb1CfLUL/B0SZeu4DcOEHEtRPTJoBcAOLmkNbfpwGn03941pf6E3 4NGkGw1CXakkzUJhP1cLvze9ug+/cdK6oq4VSN4vNq5wm8fUUge0YYDNXEd9Bh+zwJPj 5SoaAULlFHpTUUwwtLP0Vq1e0Fdl0Vz2A6kbvIGwblQ4te90TlHwOMFCSNMSB4/H+pXP MlEOqe8Bzx4SFVsuttz+bltURGxcIZQTPdE94Q+2ugerP3y7vzdX77STb8QNVVyQjX3G DKKp8ucQAaEPGeghzE1ijRjDTUyfNc6IxmIvijVYOWCJ3Un5E2EWb30uwiezn8g+XrZ6 vTaA== 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=h7TvfeFPvIPCOIWMVijVFiXcslbz1GhVm0kwKALbRpU=; b=ETvEJK0NJkwcLli8LYNrL89bKnmDYJXtRjQYyO9Z7mBmppq0rom26cu9yZeFBI8KFw G6a80HjsGSYHAXztWbhy0Tyx9QGi5hB52HpjInvfyLrwj/56s6m5RZwOUUW1PjOXzjuM T+f9BzGrsM5+THOZZlRbkMAhbZZr6OrVqC+Us4uBLRtBhBKeN/QQyKDQCm4IBEB4haEU 2Od80fjuMNUdPC+S4KbTg2kM1ykBHMISJv35jNgkeAK0OavSGMnsOA7ta1rbjRaD31ew tRMozWJ1Y6Gse66MUf8dTo6euLxN7X+md7foT3qdfKNSXUAYAYGiTsK3/kd77GMUUGqv k9xw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xb14-20020a170907070e00b00787b9cd2fe3si5315944ejb.844.2022.11.26.01.49.02; Sat, 26 Nov 2022 01:49:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229513AbiKZJoP (ORCPT + 99 others); Sat, 26 Nov 2022 04:44:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbiKZJoO (ORCPT ); Sat, 26 Nov 2022 04:44:14 -0500 Received: from smtp.smtpout.orange.fr (smtp-26.smtpout.orange.fr [80.12.242.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 379181B1CF for ; Sat, 26 Nov 2022 01:44:11 -0800 (PST) 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-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750551668211012261?= X-GMAIL-MSGID: =?utf-8?q?1750551668211012261?= 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; }