xfs: remove unnecessary check in xfile_create()
PATCH 1/1 xfs: remove unnecessary check in xfile_create()
shmem_file_setup() returns ERR_PTR() when it fails, so remove the unnecessary null pointer check.
Signed-off-by Yang Yingliang <[email protected]>
--- fs/xfs/scrub/xfile.c | 2 -- 1 file changed, 2 deletions(-)
fs/xfs/scrub/xfile.c +0 -2
@@ -70,8 +70,6 @@ xfile_create(return -ENOMEM ; xf->file =shmem_file_setup (description, isize,0 ); -if (!xf->file) - goto out_xfile;if (IS_ERR (xf->file)) { error =PTR_ERR (xf->file); goto out_xfile;
Signature · 1 line
2.25.1
Quoted 2 lines · Yang Yingliang
shmem_file_setup()returnsERR_PTR()when it fails, so remove the unnecessary null pointer check.
Technically correct, but what harm is there in leaving a null check in case the shmem_file_setup function ever /does/ start returning NULL?
--D
Quoted 21 lines
Signed-off-by Yang Yingliang <[email protected]>--- fs/xfs/scrub/xfile.c | 2 -- 1 file changed, 2 deletions(-)fs/xfs/scrub/xfile.c +0
-2@@ -70,8 +70,6 @@ xfile_create(return -ENOMEM ; xf->file =shmem_file_setup (description, isize,0 ); -if (!xf->file) - goto out_xfile;if (IS_ERR (xf->file)) { error =PTR_ERR (xf->file); goto out_xfile;Signature · 1 line
2.25.1