Skip to content

Commit f9ac75e

Browse files
tohojogregkh
authored andcommitted
wifi: ath9k: Remove error checks when creating debugfs entries
[ Upstream commit f6ffe7f ] We should not be checking the return values from debugfs creation at all: the debugfs functions are designed to handle errors of previously called functions and just transparently abort the creation of debugfs entries when debugfs is disabled. If we check the return value and abort driver initialisation, we break the driver if debugfs is disabled (such as when booting with debugfs=off). Earlier versions of ath9k accidentally did the right thing by checking the return value, but only for NULL, not for IS_ERR(). This was "fixed" by the two commits referenced below, breaking ath9k with debugfs=off starting from the 6.6 kernel (as reported in the Bugzilla linked below). Restore functionality by just getting rid of the return value check entirely. Link: https://bugzilla.kernel.org/show_bug.cgi?id=219122 Fixes: 1e41346 ("wifi: ath9k: use IS_ERR() with debugfs_create_dir()") Fixes: 6edb4ba ("wifi: ath9k: fix parameter check in ath9k_init_debug()") Reported-by: Daniel Tobias <dan.g.tob@gmail.com> Tested-by: Daniel Tobias <dan.g.tob@gmail.com> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Link: https://patch.msgid.link/20240805110225.19690-1-toke@toke.dk Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 16508f7 commit f9ac75e

2 files changed

Lines changed: 0 additions & 4 deletions

File tree

drivers/net/wireless/ath/ath9k/debug.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,8 +1380,6 @@ int ath9k_init_debug(struct ath_hw *ah)
13801380

13811381
sc->debug.debugfs_phy = debugfs_create_dir("ath9k",
13821382
sc->hw->wiphy->debugfsdir);
1383-
if (IS_ERR(sc->debug.debugfs_phy))
1384-
return -ENOMEM;
13851383

13861384
#ifdef CONFIG_ATH_DEBUG
13871385
debugfs_create_file("debug", 0600, sc->debug.debugfs_phy,

drivers/net/wireless/ath/ath9k/htc_drv_debug.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,6 @@ int ath9k_htc_init_debug(struct ath_hw *ah)
486486

487487
priv->debug.debugfs_phy = debugfs_create_dir(KBUILD_MODNAME,
488488
priv->hw->wiphy->debugfsdir);
489-
if (IS_ERR(priv->debug.debugfs_phy))
490-
return -ENOMEM;
491489

492490
ath9k_cmn_spectral_init_debug(&priv->spec_priv, priv->debug.debugfs_phy);
493491

0 commit comments

Comments
 (0)