mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] reiserfs: journal: Increase jl pointer check
@ 2022-10-25  8:47 Li zeming
  2022-10-25 21:30 ` NeilBrown
  0 siblings, 1 reply; 5+ messages in thread
From: Li zeming @ 2022-10-25  8:47 UTC (permalink / raw)
  To: willy, jlayton, song, bvanassche, neilb
  Cc: reiserfs-devel, linux-kernel, Li zeming

If kzalloc fails to allocate the jl pointer, NULL is returned directly.

Signed-off-by: Li zeming <zeming@nfschina.com>
---
 fs/reiserfs/journal.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 94addfcefede..d64e9de126c1 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -2569,6 +2569,9 @@ static struct reiserfs_journal_list *alloc_journal_list(struct super_block *s)
 	struct reiserfs_journal_list *jl;
 	jl = kzalloc(sizeof(struct reiserfs_journal_list),
 		     GFP_NOFS | __GFP_NOFAIL);
+	if (!jl)
+		return NULL;
+
 	INIT_LIST_HEAD(&jl->j_list);
 	INIT_LIST_HEAD(&jl->j_working_list);
 	INIT_LIST_HEAD(&jl->j_tail_bh_list);
-- 
2.18.2


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

end of thread, other threads:[~2022-10-26  3:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-25  8:47 [PATCH] reiserfs: journal: Increase jl pointer check Li zeming
2022-10-25 21:30 ` NeilBrown
2022-10-26  1:47   ` Li zeming
2022-10-26  3:05     ` NeilBrown
2022-10-26  3:55       ` Li zeming

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®