]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: shmem_file_setup can't return NULL
authorChristoph Hellwig <hch@lst.de>
Mon, 19 Feb 2024 06:27:17 +0000 (07:27 +0100)
committerChandan Babu R <chandanbabu@kernel.org>
Wed, 21 Feb 2024 06:06:52 +0000 (11:36 +0530)
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 <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
fs/xfs/scrub/xfile.c

index 1cf4b239bdbbd7cf362248a4cde388804d61dd3b..e649558351bc5acdc4028300ebd8b5ec4bb37d01 100644 (file)
@@ -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;