lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <91fe0855-0c78-4dc9-b55a-9dbe09bc9f51@kadam.mountain>
Date:   Mon, 24 Jul 2023 11:01:54 +0300
From:   Dan Carpenter <dan.carpenter@...aro.org>
To:     Jiri Slaby <jirislaby@...nel.org>
Cc:     Markus Elfring <Markus.Elfring@....de>,
        Luis Chamberlain <mcgrof@...nel.org>,
        Minjie Du <duminjie@...o.com>, linux-wireless@...r.kernel.org,
        kernel-janitors@...r.kernel.org, opensource.kernel@...o.com,
        LKML <linux-kernel@...r.kernel.org>,
        Kalle Valo <kvalo@...nel.org>,
        Nick Kossifidis <mickflemm@...il.com>
Subject: Re: [PATCH] drivers: wireless: ath5k: fix parameter check in
 ath5k_debug_init_device

On Thu, Jul 13, 2023 at 07:47:53AM +0200, Jiri Slaby wrote:
> On 12. 07. 23, 21:07, Markus Elfring wrote:
> > > > +++ b/drivers/net/wireless/ath/ath5k/debug.c
> > > > @@ -982,7 +982,7 @@ ath5k_debug_init_device(struct ath5k_hw *ah)
> > > >   	ah->debug.level = ath5k_debug;
> > > > 
> > > >   	phydir = debugfs_create_dir("ath5k", ah->hw->wiphy->debugfsdir);
> > > -	if (!phydir)
> > > > +	if (IS_ERR(phydir))
> > > 
> > > Please use IS_ERR_OR_NULL() instead.

The correct thing for debugfs is to delete the error handling entirely.
Checking for NULL is harmless but checking for IS_ERR() will break the
driver if debugfs is turned off.

Debugfs is a special case where the error handling was deliberately
written so that it's basically impossible to do it correctly.  Because
as I said at the start, the correct thing is to delete it.

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ