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: <ZK6a-f2Se3HWjU7D@orome>
Date:   Wed, 12 Jul 2023 14:22:17 +0200
From:   Thierry Reding <thierry.reding@...il.com>
To:     Minjie Du <duminjie@...o.com>
Cc:     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>,
        opensource.kernel@...o.com
Subject: Re: [PATCH v1] iommu: fix parameter check in
 tegra_smmu_debugfs_init()

On Wed, Jul 12, 2023 at 07:31:45PM +0800, Minjie Du wrote:
> Make IS_ERR() judge the debugfs_create_dir() function return
> in tegra_smmu_debugfs_init()
> 
> Signed-off-by: Minjie Du <duminjie@...o.com>
> ---
>  drivers/iommu/tegra-smmu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
> index 1cbf063cc..841e14cce 100644
> --- a/drivers/iommu/tegra-smmu.c
> +++ b/drivers/iommu/tegra-smmu.c
> @@ -1056,7 +1056,7 @@ DEFINE_SHOW_ATTRIBUTE(tegra_smmu_clients);
>  static void tegra_smmu_debugfs_init(struct tegra_smmu *smmu)
>  {
>  	smmu->debugfs = debugfs_create_dir("smmu", NULL);
> -	if (!smmu->debugfs)
> +	if (IS_ERR(smmu->debugfs))
>  		return;

I think we can just drop the error check altogether since
debugfs_create_file() will simply return early if smmu->debugfs is an
error pointer.

Thierry

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ