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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 2 May 2023 20:06:34 +0300
From:   Dan Carpenter <dan.carpenter@...aro.org>
To:     Tomas Henzl <thenzl@...hat.com>
Cc:     Jing Xu <U202112064@...t.edu.cn>,
        Sathya Prakash <sathya.prakash@...adcom.com>,
        Sreekanth Reddy <sreekanth.reddy@...adcom.com>,
        Suganath Prabu Subramani 
        <suganath-prabu.subramani@...adcom.com>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        hust-os-kernel-patches@...glegroups.com,
        Dongliang Mu <dzm91@...t.edu.cn>,
        MPT-FusionLinux.pdl@...adcom.com, linux-scsi@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drivers: mpt3sas: mpt3sas_debugfs: return value check of
 `mpt3sas_debugfs_root`

On Tue, May 02, 2023 at 05:53:10PM +0200, Tomas Henzl wrote:
> On 4/23/23 14:25, Jing Xu wrote:
> > Smatch complains that:
> > mpt3sas_init_debugfs() warn: 'mpt3sas_debugfs_root' is an error 
> > pointer or valid
> > 
> > There is no need to check the return value of the debugfs_create_dir() 
> > function, just delete the dead code.
> > 
> > Fixes: 2b01b293f359 ("scsi: mpt3sas: Capture IOC data for debugging purposes")
> > Signed-off-by: Jing Xu <U202112064@...t.edu.cn>
> > Reviewed-by: Dongliang Mu <dzm91@...t.edu.cn>
> > ---
> >  drivers/scsi/mpt3sas/mpt3sas_debugfs.c | 2 --
> >  1 file changed, 2 deletions(-)
> > 
> > diff --git a/drivers/scsi/mpt3sas/mpt3sas_debugfs.c b/drivers/scsi/mpt3sas/mpt3sas_debugfs.c
> > index a6ab1db81167..c92e08c130b9 100644
> > --- a/drivers/scsi/mpt3sas/mpt3sas_debugfs.c
> > +++ b/drivers/scsi/mpt3sas/mpt3sas_debugfs.c
> > @@ -99,8 +99,6 @@ static const struct file_operations mpt3sas_debugfs_iocdump_fops = {
> >  void mpt3sas_init_debugfs(void)
> >  {
> >  	mpt3sas_debugfs_root = debugfs_create_dir("mpt3sas", NULL);
> > -	if (!mpt3sas_debugfs_root)
> > -		pr_info("mpt3sas: Cannot create debugfs root\n");
> Hi Jing,
> most drivers just ignore the return value but here the author wanted to
> have the information logged.
> Can you instead of removing the message modify the 'if' condition so it
> suits the author's intention?

This code was always just wrong.

The history of this is slightly complicated and boring.  These days it's
harmless dead code so I guess it's less bad than before.


regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ