From patchwork Mon Oct 24 11:28:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9081 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp445529wru; Mon, 24 Oct 2022 06:12:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6QrcZCTbILuxQ2luNFszhwmewyB9UwNLgiwmD6G6z68xUG+EP6ac1gOEeHmXY1B0ld9N2J X-Received: by 2002:a17:902:778f:b0:17f:8347:ff83 with SMTP id o15-20020a170902778f00b0017f8347ff83mr32956323pll.146.1666617165479; Mon, 24 Oct 2022 06:12:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666617165; cv=none; d=google.com; s=arc-20160816; b=VRJrIfOwcVf6dGuiF8heu+fclqLZUNKOpZjC9Z2DRM2ccN+0QJI7ZnWLx3tV9kdNXR KsVDsx/LoOvMVDKD843coKorNxg3I7KKbCoM1JYebLwp4t5BS5w6FAemH6e1uTvc0d1f 7sRRp2c94hz84icVi1YjLMHlqgxaz1o6k594rQ/uFeo05cdVgsvDm1vzkTmXAugOkC56 +pIQI6WdsGNrVIL2BBVRpw2M4hsu6kkTVF1pvPnCMwyv9c6jPqGb1pG+tU2HH+1Sksbw +hKLwotT3f2VyR/6ClQts0NvcN8tWiDF8TdC5qJrm+f4deCC+05Ghb1nPNIkhx4pbBSH HNZQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=K/uOf0SUzijjEeSOOrVTXr5R6N7cfa3tA6My4fiILe0=; b=X+5KBwWwGP6oU/vU5kZFyr+I9InGTveetUua7z3Mz7S8Ai/NWPGjS1jVwZxGP//s1F 5DAkmTcfga/giI2GPdtbKpd8yhNOBxwo+WsbCTiZgVZJsr/2iX2H/Cvy8RHmxvbhPNsX g56J88OYhtOFNo1tQ7Q/fKtAHTr2t5GnC/nshwG9PDJC5rVjdT8V+SXCO23k8iphQNqG azBnBwUhjNBvuk7Nk1Wr409pXIyC4My/jziuKYhX9n4xuJJMjE3mGoNNoZaKKaC7OL1C vUcRbT+kPrHpJyubxMcXY2I59sSQ1QLPnPUzvpbso5n4cZYMUQga1rAPUZ3m308cH/OJ FD7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MiPBXoMo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i71-20020a63874a000000b0046ebe02836fsi11342827pge.504.2022.10.24.06.12.31; Mon, 24 Oct 2022 06:12:45 -0700 (PDT) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MiPBXoMo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235661AbiJXNMH (ORCPT + 99 others); Mon, 24 Oct 2022 09:12:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235869AbiJXNJx (ORCPT ); Mon, 24 Oct 2022 09:09:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F3E9A220F; Mon, 24 Oct 2022 05:23:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 631E061017; Mon, 24 Oct 2022 12:20:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 718DBC433D7; Mon, 24 Oct 2022 12:20:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614055; bh=yMjsvMrwdteaqkm298N96x25owWkPZMp9jiYpvA0zcQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MiPBXoMoKD4JtR7suqU09PV9J6dqFXx+l+o93b9emNnK6AmmifgORPxmYmhhlJgni Bh56M+4VRIeOxhq4y/U9ZQUFNqM3NaI4pdHBfkVsJH7ALoCWs+RWjqlNG0ghZMC/Wn ONte77Cxj9jvV2MNn9mELngqOvk4hqmJLou/JCL8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , Alex Elder , stable Subject: [PATCH 5.10 085/390] staging: greybus: audio_helper: remove unused and wrong debugfs usage Date: Mon, 24 Oct 2022 13:28:02 +0200 Message-Id: <20221024113026.227109380@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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?1747574760781360876?= X-GMAIL-MSGID: =?utf-8?q?1747574760781360876?= From: Greg Kroah-Hartman commit d517cdeb904ddc0cbebcc959d43596426cac40b0 upstream. In the greybus audio_helper code, the debugfs file for the dapm has the potential to be removed and memory will be leaked. There is also the very real potential for this code to remove ALL debugfs entries from the system, and it seems like this is what will really happen if this code ever runs. This all is very wrong as the greybus audio driver did not create this debugfs file, the sound core did and controls the lifespan of it. So remove all of the debugfs logic from the audio_helper code as there's no way it could be correct. If this really is needed, it can come back with a fixup for the incorrect usage of the debugfs_lookup() call which is what caused this to be noticed at all. Cc: Johan Hovold Cc: Alex Elder Cc: Greg Kroah-Hartman Cc: stable Link: https://lore.kernel.org/r/20220902143715.320500-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/audio_helper.c | 11 ----------- 1 file changed, 11 deletions(-) --- a/drivers/staging/greybus/audio_helper.c +++ b/drivers/staging/greybus/audio_helper.c @@ -3,7 +3,6 @@ * Greybus Audio Sound SoC helper APIs */ -#include #include #include #include @@ -116,10 +115,6 @@ int gbaudio_dapm_free_controls(struct sn { int i; struct snd_soc_dapm_widget *w, *next_w; -#ifdef CONFIG_DEBUG_FS - struct dentry *parent = dapm->debugfs_dapm; - struct dentry *debugfs_w = NULL; -#endif mutex_lock(&dapm->card->dapm_mutex); for (i = 0; i < num; i++) { @@ -139,12 +134,6 @@ int gbaudio_dapm_free_controls(struct sn continue; } widget++; -#ifdef CONFIG_DEBUG_FS - if (!parent) - debugfs_w = debugfs_lookup(w->name, parent); - debugfs_remove(debugfs_w); - debugfs_w = NULL; -#endif gbaudio_dapm_free_widget(w); } mutex_unlock(&dapm->card->dapm_mutex);