From 233886dd32ad71daf9c21bf3728c0933a94870f0 Mon Sep 17 00:00:00 2001 From: "jblunck@suse.de" Date: Mon, 21 Nov 2005 21:32:36 -0800 Subject: [PATCH] [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 --- drivers/md/dm-bio-list.h | 3 +++ 1 file changed, 3 insertions(+) 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