[PATCH v1] drivers: wireless: mt76: fix parameter check in mt76_register_debugfs_fops()
Nicolas Escande
nico.escande at gmail.com
Wed Jul 12 07:00:20 PDT 2023
On Wed Jul 12, 2023 at 3:00 PM CEST, Minjie Du wrote:
> Make IS_ERR() judge the debugfs_create_dir() function return
> in mt76_register_debugfs_fops().
>
> Signed-off-by: Minjie Du <duminjie at vivo.com>
> ---
> drivers/net/wireless/mediatek/mt76/debugfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/debugfs.c b/drivers/net/wireless/mediatek/mt76/debugfs.c
> index 57fbcc83e..d9ba70013 100644
> --- a/drivers/net/wireless/mediatek/mt76/debugfs.c
> +++ b/drivers/net/wireless/mediatek/mt76/debugfs.c
> @@ -109,7 +109,7 @@ mt76_register_debugfs_fops(struct mt76_phy *phy,
> struct dentry *dir;
>
> dir = debugfs_create_dir("mt76", phy->hw->wiphy->debugfsdir);
> - if (!dir)
> + if (IS_ERR(dir))
> return NULL;
Check the mailing list this subject has been discussed many times...
I believe the current state of the art is to remove the check altogether
>
> debugfs_create_u8("led_pin", 0600, dir, &phy->leds.pin);
More information about the linux-arm-kernel
mailing list