mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] iommu/tegra-smmu: fix error checking for debugfs_create_dir()
@ 2023-10-25 11:01 Dario Binacchi
  2023-10-25 11:25 ` Baolu Lu
  0 siblings, 1 reply; 4+ messages in thread
From: Dario Binacchi @ 2023-10-25 11:01 UTC (permalink / raw)
  To: linux-kernel
  Cc: Dario Binacchi, Joerg Roedel, Jonathan Hunter, Krishna Reddy,
	Robin Murphy, Thierry Reding, Will Deacon, iommu, linux-tegra

The return value of debugfs_create_dir() should be checked using the
IS_ERR() function.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.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 e445f80d0226..cd1d80c4c673 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;
 
 	debugfs_create_file("swgroups", S_IRUGO, smmu->debugfs, smmu,
-- 
2.42.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-31  7:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-25 11:01 [PATCH] iommu/tegra-smmu: fix error checking for debugfs_create_dir() Dario Binacchi
2023-10-25 11:25 ` Baolu Lu
2023-10-30 15:30   ` Thierry Reding
2023-10-31  7:54     ` Dario Binacchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®