public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] xfs: remove unnecessary check in xfile_create()
@ 2023-08-24  9:15 Yang Yingliang
  2023-08-24 16:14 ` Darrick J. Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2023-08-24  9:15 UTC (permalink / raw)
  To: linux-xfs; +Cc: chandan.babu, djwong, kent.overstreet, dchinner, yangyingliang

shmem_file_setup() returns ERR_PTR() when it fails,
so remove the unnecessary null pointer check.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 fs/xfs/scrub/xfile.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/xfs/scrub/xfile.c b/fs/xfs/scrub/xfile.c
index d98e8e77c684..71779d81cad7 100644
--- a/fs/xfs/scrub/xfile.c
+++ b/fs/xfs/scrub/xfile.c
@@ -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;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-24 16:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-24  9:15 [PATCH -next] xfs: remove unnecessary check in xfile_create() Yang Yingliang
2023-08-24 16:14 ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox