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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EF83CE79D4 for ; Wed, 20 Sep 2023 12:36:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235767AbjITMg6 (ORCPT ); Wed, 20 Sep 2023 08:36:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235918AbjITMg5 (ORCPT ); Wed, 20 Sep 2023 08:36:57 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D09C883 for ; Wed, 20 Sep 2023 05:36:51 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22FB1C433CC; Wed, 20 Sep 2023 12:36:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1695213411; bh=2bs2NHmta7Mxx+Fc2/ELAiPdc4PJO6KXWo5vx6NoczY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jFbdL/i9UuPud+5g5QktXYeiLXNzz8quT2k/Z0g/4Z/6Umrh+HaL0QsU7kIpvlFBc 6KIVh/zh3rPPWw2EfzEAJdBpTMp8Rx1bQVI4ZOO2H/87wu6g1aUsZWvtQjw3LdyQRM 0DYvqiVFd9fsy6goSX/h2X7/jNuOeBtv/bIvGiak= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Boris Brezillon , Dhruva Gole , Chanwoo Choi Subject: [PATCH 5.4 210/367] PM / devfreq: Fix leak in devfreq_dev_release() Date: Wed, 20 Sep 2023 13:29:47 +0200 Message-ID: <20230920112904.045745879@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230920112858.471730572@linuxfoundation.org> References: <20230920112858.471730572@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Boris Brezillon commit 5693d077595de721f9ddbf9d37f40e5409707dfe upstream. srcu_init_notifier_head() allocates resources that need to be released with a srcu_cleanup_notifier_head() call. Reported by kmemleak. Fixes: 0fe3a66410a3 ("PM / devfreq: Add new DEVFREQ_TRANSITION_NOTIFIER notifier") Cc: Signed-off-by: Boris Brezillon Reviewed-by: Dhruva Gole Signed-off-by: Chanwoo Choi Signed-off-by: Greg Kroah-Hartman --- drivers/devfreq/devfreq.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -595,6 +595,7 @@ static void devfreq_dev_release(struct d devfreq->profile->exit(devfreq->dev.parent); mutex_destroy(&devfreq->lock); + srcu_cleanup_notifier_head(&devfreq->transition_notifier_list); kfree(devfreq); }