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: <db554c27-f663-0146-5e5f-b319547757c3@linux.intel.com>
Date:   Sat, 15 Jul 2023 14:26:10 +0800
From:   Baolu Lu <baolu.lu@...ux.intel.com>
To:     Minjie Du <duminjie@...o.com>,
        Thierry Reding <thierry.reding@...il.com>,
        Krishna Reddy <vdumpa@...dia.com>,
        Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
        Robin Murphy <robin.murphy@....com>,
        Jonathan Hunter <jonathanh@...dia.com>,
        "open list:TEGRA IOMMU DRIVERS" <linux-tegra@...r.kernel.org>,
        "open list:IOMMU SUBSYSTEM" <iommu@...ts.linux.dev>,
        open list <linux-kernel@...r.kernel.org>
Cc:     baolu.lu@...ux.intel.com, opensource.kernel@...o.com
Subject: Re: [PATCH v5] iommu: Fix an error check in tegra_smmu_debugfs_init()

On 7/14/23 4:13 PM, Minjie Du wrote:
> debugfs_create_dir() function returns an error value(PTR_ERR).
> We need to evaluate the return value using IS_ERR,
> rather than checking for NULL.
> 
> Fixes: d1313e7896e9 ("iommu/tegra-smmu: Add debugfs support")
> Signed-off-by: Minjie Du<duminjie@...o.com>
> ---
> V4 -> V5: debugfs needs to have error checking, so use IS_ERR() to error check.

Why?

[...]
  * NOTE: it's expected that most callers should _ignore_ the errors 
returned
  * by this function. Other debugfs functions handle the fact that the 
"dentry"
  * passed to them could be an error and they don't crash in that case.
  * Drivers should generally work fine even if debugfs fails to init anyway.
  */
struct dentry *debugfs_create_dir(const char *name, struct dentry *parent)
{
         struct dentry *dentry = start_creating(name, parent);
         struct inode *inode;

         if (IS_ERR(dentry))
                 return dentry;

[...]

Best regards,
baolu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ