mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] jfs: Use more common error handling code in jfs_readdir()
@ 2026-06-16 18:00 Markus Elfring
  0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2026-06-16 18:00 UTC (permalink / raw)
  To: jfs-discussion, Arnd Bergmann, Dave Kleikamp, Mike Rapoport,
	Yun Zhou, Zheng Yu
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 16 Jun 2026 19:50:07 +0200

Use an existing label once more so that a bit of exception handling can be
better reused at the end of this function implementation.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 fs/jfs/jfs_dtree.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index 8ce6e4458cc2..f0efdffb9e5c 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -3036,10 +3036,8 @@ int jfs_readdir(struct file *file, struct dir_context *ctx)
 		}
 
 		DT_GETPAGE(ip, bn, mp, PSIZE, p, rc);
-		if (rc) {
-			kfree(dirent_buf);
-			return rc;
-		}
+		if (rc)
+			goto out;
 	}
 
       out:
-- 
2.54.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-16 18:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-16 18:00 [PATCH] jfs: Use more common error handling code in jfs_readdir() Markus Elfring

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

all inboxes | Powered by JetHome®