From: jblunck@suse.de Date: Tue, 22 Nov 2005 05:32:36 +0000 (-0800) Subject: [PATCH] device-mapper snapshot: bio_list fix X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=233886dd32ad71daf9c21bf3728c0933a94870f0;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [PATCH] device-mapper snapshot: bio_list fix bio_list_merge() should do nothing if the second list is empty - not oops. Signed-off-by: Alasdair G Kergon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/md/dm-bio-list.h b/drivers/md/dm-bio-list.h index bc021e1fd4d1..bbf4615f0e30 100644 --- a/drivers/md/dm-bio-list.h +++ b/drivers/md/dm-bio-list.h @@ -33,6 +33,9 @@ static inline void bio_list_add(struct bio_list *bl, struct bio *bio) static inline void bio_list_merge(struct bio_list *bl, struct bio_list *bl2) { + if (!bl2->head) + return; + if (bl->tail) bl->tail->bi_next = bl2->head; else