Skip to contentSkip to conversation

jfs: Use more common error handling code in jfs_readdir()

PATCH New Markus Elfring 1 participant 1 message Jun 16

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 jfs: Use more common error handling code in jfs_readdir()

From: Markus Elfring <[email protected]>
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.

---
 fs/jfs/jfs_dtree.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
fs/jfs/jfs_dtree.c +2 -4
index 8ce6e4458cc2..f0efdffb9e5c 100644
@@ -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:
Signature · 1 line
2.54.0