mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-29 05:18:00 +00:00
lazy-pages: merge_iov_lists: fix corner case of empty destination
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
48d9930055
commit
12cc41f671
@ -419,6 +419,14 @@ static void merge_iov_lists(struct list_head *src, struct list_head *dst)
|
||||
{
|
||||
struct lazy_iov *iov, *p, *n;
|
||||
|
||||
if (list_empty(src))
|
||||
return;
|
||||
|
||||
if (list_empty(dst)) {
|
||||
iov = list_first_entry(src, struct lazy_iov, l);
|
||||
list_move(&iov->l, dst);
|
||||
}
|
||||
|
||||
list_for_each_entry_safe(iov, n, src, l) {
|
||||
list_for_each_entry(p, dst, l) {
|
||||
if (iov->start < p->start) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user