summaryrefslogtreecommitdiff
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-02-19 09:27:17 +0300
committerChandan Babu R <chandanbabu@kernel.org>2024-02-21 09:06:52 +0300
commit1b07ea2ab3dc0307f80c735cba8c3ef690bd9aab (patch)
tree291f77cfcde352ce23430493473b39b93d74af1b /fs/xfs
parentb44c0eb8ae9c3e22cfa113774134673ac18ac848 (diff)
downloadlinux-1b07ea2ab3dc0307f80c735cba8c3ef690bd9aab.tar.xz
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 <hch@lst.de> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/scrub/xfile.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/xfs/scrub/xfile.c b/fs/xfs/scrub/xfile.c
index 1cf4b239bdbb..e649558351bc 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;