Re: [syzbot] [gfs2?] general protection fault in gfs2_remove_from_journal (2)

Qing Wang <[email protected]>
Newsgroups dev.linux.lists.gfs2,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
#syz test

diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c
index e4356198d8d8..3a60a8bd80f7 100644
--- a/fs/gfs2/meta_io.c
+++ b/fs/gfs2/meta_io.c
@@ -349,7 +349,8 @@ void gfs2_remove_from_journal(struct buffer_head *bh, int meta)
 	if (test_clear_buffer_pinned(bh)) {
 		trace_gfs2_pin(bd, 0);
 		atomic_dec(&sdp->sd_log_pinned);
-		list_del_init(&bd->bd_list);
+		if (bd)
+			list_del_init(&bd->bd_list);
 		if (meta == REMOVE_META)
 			tr->tr_num_buf_rm++;
 		else
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.