Skip to contentSkip to conversation

bcachefs: handle printbuf ENOMEM before use

PATCH New David Disseldorp 1 participant 1 message Sep 24, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bcachefs: handle printbuf ENOMEM before use

Fixes 9c5d38bba0342 ("bcachefs: Don't print out duplicate fsck errors")
---
 fs/bcachefs/error.c | 5 +++++
 1 file changed, 5 insertions(+)
fs/bcachefs/error.c +5 -0
index 95afa7bf20205..b2c188c2d4e37 100644
@@ -251,6 +251,11 @@ int __bch2_fsck_err(struct bch_fs *c,
 	prt_vprintf(out, fmt, args);
 	va_end(args);
 
+	if (out->allocation_failure) {
+		ret = -ENOMEM;
+		goto err;
+	}
+
 	/* Custom fix/continue/recreate/etc.? */
 	if (out->buf[out->pos - 1] == '?') {
 		const char *p = strrchr(out->buf, ',');
Signature · 1 line
2.43.0