From: Dan Carpenter Date: Fri, 14 Oct 2022 09:36:53 +0000 (+0300) Subject: ceph: fix a NULL vs IS_ERR() check when calling ceph_lookup_inode() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f86a48667b91202d502d753c707e8576a6fe265b;p=linux.git ceph: fix a NULL vs IS_ERR() check when calling ceph_lookup_inode() The ceph_lookup_inode() function returns error pointers. It never returns NULL. Fixes: aa87052dd965 ("ceph: fix incorrectly showing the .snap size for stat") Signed-off-by: Dan Carpenter Reviewed-by: Jeff Layton Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov --- diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 4af5e55abc158..bad9eeb6a1a59 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -2492,7 +2492,7 @@ int ceph_getattr(struct user_namespace *mnt_userns, const struct path *path, struct inode *parent; parent = ceph_lookup_inode(sb, ceph_ino(inode)); - if (!parent) + if (IS_ERR(parent)) return PTR_ERR(parent); pci = ceph_inode(parent);