Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3202551lqo; Tue, 21 May 2024 09:32:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU3UZH1dI+RNClJBVlAxY/7LGI7vXBt93RWjFM3tUWB154Y61U48/jX5e0B75IRgS7GuyzcWVLtr1D8JiRJQCriaxW072JNd0JuJs2nkg== X-Google-Smtp-Source: AGHT+IEWhIWj9VmVzF5PIHEOGJU0DaZDpH0VJ5vN7/C024djBmvOp3fTIH1tQ2LOxASuH8Nsde7D X-Received: by 2002:a17:903:1212:b0:1ee:10de:2c85 with SMTP id d9443c01a7336-1ef44059939mr337347005ad.58.1716309152304; Tue, 21 May 2024 09:32:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716309152; cv=pass; d=google.com; s=arc-20160816; b=ShCGoAhYh5SCps1izpPXsYMPCCaDgjUdxyCB+jvGNw/nN73Tz6CH+JwcUK3OAbUP2a iRI7fhMnsOpVRgKQOI3pERv7ZmyWRcpqCecuIp+t/XOyrYBftYSo7RTsCMNvlPaJ3OlK vhCTt4+xOkNqQW216Xc5u/htXO5E/bmI+9FqiElGvksF7VKFu8+mb7KoQy16Zayt5hcg kvbH88YsYJzM8bOLR+2a/TFc3MyRR+v1Awk+s5XjhJJexWvOb8QtX+iBMBXgZDdUaPD7 Gd2teKLqQgLSXmR1bVKDjIaju7zeV0xQKnmiJ5HyjJBAeZpFNuBjFvNaXLNM46hmT8rE DWAg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=OmRDA0itX7XrtwZPRwWsuyMwkAkOVlwHcocV3ciigng=; fh=NcJMVFNaR8bzRgLN6H4coLXdbR1fdwxxAYxDB/lPPz0=; b=uH0DwuZ3QVo6HPBqoqwGGZPqmQkDiohY4tkWAhWZFJWEBbtCkU1HRMt3crh/dXPLjr NNYKoFsMw5E6pp9IME5iE8coDWaYQyBMjP/DH2IDIXFoaqe7KSL2tYnCF4+W2QNcl45S b+XlAptc1BT3lMPyO+F3lcjz5Mq2kXCIfzvKgMQKkt5icfMtSraiwzyAAaxC7o9mR2Ah FP229d3Cr6n8NKjQWcS8lBM5XsiXnK5JEqwN6FOShmfGj2Jy2EpTjlmxYFdnmzJWLmCo iSGwMYN/sPtup8XWEmuGWFl3ssIKMQbPGxE+gY+wiWK1AOjnoRkVkJR9NXOjXJh1VKJQ Dj8g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gpxsee.org); spf=pass (google.com: domain of linux-kernel+bounces-185217-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185217-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f3082eb331si22281155ad.13.2024.05.21.09.32.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 09:32:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185217-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gpxsee.org); spf=pass (google.com: domain of linux-kernel+bounces-185217-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185217-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 70A3B282EE9 for ; Tue, 21 May 2024 16:32:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9451B1474DA; Tue, 21 May 2024 16:31:57 +0000 (UTC) Received: from mx.gpxsee.org (mx.gpxsee.org [37.205.14.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21D06770FA; Tue, 21 May 2024 16:31:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=37.205.14.76 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716309117; cv=none; b=ZBFdXvzkf9GXWAMRJ1ZZqtNQKf95U6742xYAxCNl6XTVZ0gPkc8A7A/TEJmvthQ3eqi+xL4D7bH3Mx4zT3+xaZ1MlteSFWHRdZi1LPCLnvMOUJyNsf65cx1edJWjhlznKqGEWNKqkgNWZj7+wAnsW11mZ/YCZfKbVEAQ72IpP6U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716309117; c=relaxed/simple; bh=oxguKI1qcmt3W5qVgb31faLtwWPB+K37V7CO7pLboS4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=bDwqU+2NOhznAWl/Cy4xUXVtbkpXxDiuVdaokStN6L2kOe6cB+uyUdxSy7NKpjzUG72zxtyxTq7iVjPk6kGI0Sr+4q11pesaZiO4fWZK+cxXZWbuG6nAoocfl3D9JyneZ4nQVFHGxNkvMGn9PU1PyLDTQk0oZl7JgN+G1IocJ/E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gpxsee.org; spf=pass smtp.mailfrom=gpxsee.org; arc=none smtp.client-ip=37.205.14.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gpxsee.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gpxsee.org Received: from mgb4.. (unknown [62.77.71.229]) by mx.gpxsee.org (Postfix) with ESMTPSA id 6FE8F5B0BE; Tue, 21 May 2024 18:23:03 +0200 (CEST) From: tumic@gpxsee.org To: Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Martin=20T=C5=AFma?= Subject: [PATCH] media: mgb4: Fix double debugfs remove Date: Tue, 21 May 2024 18:22:54 +0200 Message-ID: <20240521162254.3025-1-tumic@gpxsee.org> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Martin Tůma Fixes an error where debugfs_remove_recursive() is called first on a parent directory and then again on a child which causes a kernel panic. Signed-off-by: Martin Tůma --- drivers/media/pci/mgb4/mgb4_core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/pci/mgb4/mgb4_core.c b/drivers/media/pci/mgb4/mgb4_core.c index 60498a5abebf..ab4f07e2e560 100644 --- a/drivers/media/pci/mgb4/mgb4_core.c +++ b/drivers/media/pci/mgb4/mgb4_core.c @@ -642,9 +642,6 @@ static void mgb4_remove(struct pci_dev *pdev) struct mgb4_dev *mgbdev = pci_get_drvdata(pdev); int i; -#ifdef CONFIG_DEBUG_FS - debugfs_remove_recursive(mgbdev->debugfs); -#endif #if IS_REACHABLE(CONFIG_HWMON) hwmon_device_unregister(mgbdev->hwmon_dev); #endif @@ -659,6 +656,10 @@ static void mgb4_remove(struct pci_dev *pdev) if (mgbdev->vin[i]) mgb4_vin_free(mgbdev->vin[i]); +#ifdef CONFIG_DEBUG_FS + debugfs_remove_recursive(mgbdev->debugfs); +#endif + device_remove_groups(&mgbdev->pdev->dev, mgb4_pci_groups); free_spi(mgbdev); free_i2c(mgbdev); base-commit: 8771b7f31b7fff91a998e6afdb60650d4bac59a5 -- 2.44.0