From: Christoph Hellwig Date: Mon, 19 Feb 2024 06:27:17 +0000 (+0100) Subject: xfs: shmem_file_setup can't return NULL X-Git-Tag: v6.9-rc1~129^2~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1b07ea2ab3dc0307f80c735cba8c3ef690bd9aab;p=thirdparty%2Fkernel%2Flinux.git xfs: shmem_file_setup can't return NULL shmem_file_setup always returns a struct file pointer or an ERR_PTR, so remove the code to check for a NULL return. Signed-off-by: Christoph Hellwig Reviewed-by: "Darrick J. Wong" Signed-off-by: Chandan Babu R --- diff --git a/fs/xfs/scrub/xfile.c b/fs/xfs/scrub/xfile.c index 1cf4b239bdbbd..e649558351bc5 100644 --- a/fs/xfs/scrub/xfile.c +++ b/fs/xfs/scrub/xfile.c @@ -62,15 +62,13 @@ xfile_create( { struct inode *inode; struct xfile *xf; - int error = -ENOMEM; + int error; xf = kmalloc(sizeof(struct xfile), XCHK_GFP_FLAGS); if (!xf) return -ENOMEM; xf->file = shmem_file_setup(description, isize, VM_NORESERVE); - if (!xf->file) - goto out_xfile; if (IS_ERR(xf->file)) { error = PTR_ERR(xf->file); goto out_xfile;