diff
 void btrfs_clear_buffer_dirty(struct btrfs_trans_handle *trans,
 			      struct extent_buffer *eb)
 {
+	if (!eb)
+		return;
 	struct btrfs_fs_info *fs_info = eb->fs_info;
 	int num_folios;
 	// ... rest of the function ...
