Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3958533rwi; Sat, 22 Oct 2022 02:55:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7F7iqi6MQQ3DAAjvgLsJre5OPv4RYausHUhePBHojRMtbq0MZlyuMNzBBSlcnUbiG3xPQm X-Received: by 2002:a17:902:d510:b0:185:4b76:6277 with SMTP id b16-20020a170902d51000b001854b766277mr23245320plg.82.1666432507191; Sat, 22 Oct 2022 02:55:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666432507; cv=none; d=google.com; s=arc-20160816; b=G6uueeV73dwtUMkrCrtDGoZNscDc0W9fe2yABdLgwToH7ra9FmA6u4++GfA5moQM64 /Q09sevx+UmslOo9+ArWd79OJmtjykyDB/5f7EUbbTGEAIKf/2LtPaNmVLBEW065t08K a3cBZlKCyyU6oju85q3kBwwIimiERAofdPZxIXDqXMcfJOKejeArtY0Jb6l2lkVvfQ5J m3uGF9vTYnhpkkue4QngIuDD1FjIvVU2U8lA6ptT9iI/o64F7f3vPpXs+M4JGTca04pf U1BDZelAf7+HIYv3t8WVy8sgyct/11VTN8FRq7NW8dK3wm7DqW+o3xzMX3gnrKwWvy0f JY4w== 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=U/f9KYrQ+DMWS4X23mMQtSYvbVR5lIn4pA3ZZWQrsSR8kiN6zmB+hA5PhSY8g903WY ciD7UApDZLtiMj5Ur6bRRJYNT0i645K23BuAXs0JEM3Vn4barMWeN7xuS+1mUxwOJiWj loj6yD9dL3PoqTQEOrvN0TxsZ1iitwvnP0IXDbVxyMHegDdprtsW6Kym7E+Jq78vH2hg AH6miSVbpLaKThHpf5N3MY90084p0J4bNe+LHxpGAMxMqp3jICTqSFkFnjmLn+DfsHLS CAcqu/1AoWeQHkfLDjRDn04PUSV+0wmzAqeOr5oxMUuBwJqU4UuSRviaIfvQLkaS2C2O oBpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LEXdAFJa; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b6-20020a170902d88600b00178af7f1832si26280783plz.216.2022.10.22.02.54.55; Sat, 22 Oct 2022 02:55:07 -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=LEXdAFJa; 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 S233530AbiJVIUM (ORCPT + 99 others); Sat, 22 Oct 2022 04:20:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233630AbiJVIS7 (ORCPT ); Sat, 22 Oct 2022 04:18:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 532962CCA2E; Sat, 22 Oct 2022 00:57:58 -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 ams.source.kernel.org (Postfix) with ESMTPS id 70F67B82E0F; Sat, 22 Oct 2022 07:42:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95192C433C1; Sat, 22 Oct 2022 07:42:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424533; bh=yMjsvMrwdteaqkm298N96x25owWkPZMp9jiYpvA0zcQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LEXdAFJaoxPt/KzXnu989Z4E/Kr6g5yXLuSeG3FzRP/AbobYKlcrYvEbhPbN3ulJH uUphkDxofe8yxpuBcOcm6IqGBizr0xsbKJCkBVjhAyEnD4yrr/k2Tx5erizOE79Sqx 9HKFyvTf8RuCk/dbuFdTkB6Dxdznb+smsARu1osA= 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.19 164/717] staging: greybus: audio_helper: remove unused and wrong debugfs usage Date: Sat, 22 Oct 2022 09:20:43 +0200 Message-Id: <20221022072444.515361630@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.3 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 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);