[PATCH v1 1/2] fs: Fix return in orangefs_mkdir
From: Hongling Zeng
Date: Fri May 01 2026 - 22:55:02 EST
Return NULL instead of passing to ERR_PTR while err is zero
Fixes smatch warnings:
- fs/orangefs/namei.c:369 orangefs_mkdir() warn: passing zero
to 'ERR_PTR'
Fixes: 88d5baf69082 ("Change inode_operations.mkdir to return struct dentry *")
Signed-off-by: Hongling Zeng <zenghongling@xxxxxxxxxx>
Reviewed-by: Jori Koolstra <jkoolstra@xxxxxxxxx>
---
Change in v1:
-Per review
--
---
fs/orangefs/namei.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/orangefs/namei.c b/fs/orangefs/namei.c
index bec5475de094..75e65e72c2d6 100644
--- a/fs/orangefs/namei.c
+++ b/fs/orangefs/namei.c
@@ -362,7 +362,7 @@ static struct dentry *orangefs_mkdir(struct mnt_idmap *idmap, struct inode *dir,
__orangefs_setattr(dir, &iattr);
out:
op_release(new_op);
- return ERR_PTR(ret);
+ return ret ? ERR_PTR(ret) : NULL;
}
static int orangefs_rename(struct mnt_idmap *idmap,
--
2.25.1