Skip to content

Commit

Permalink
migration/multifd: Fix p->iov leak in multifd-uadk.c
Browse files Browse the repository at this point in the history
The send_cleanup() hook should free the p->iov that was allocated at
send_setup(). This was missed because the UADK code is conditional on
the presence of the accelerator, so it's not tested by default.

Fixes: 819dd20 ("migration/multifd: Add UADK initialization")
Reported-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
(cherry picked from commit 405e352d28c24991cacfdebccf67d56c4795cf6e)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
Fabiano Rosas authored and Michael Tokarev committed Sep 25, 2024
1 parent f84b79a commit 9cd1fd4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions migration/multifd-uadk.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ static void multifd_uadk_send_cleanup(MultiFDSendParams *p, Error **errp)

multifd_uadk_uninit_sess(wd);
p->compress_data = NULL;
g_free(p->iov);
p->iov = NULL;
}

static inline void prepare_next_iov(MultiFDSendParams *p, void *base,
Expand Down

0 comments on commit 9cd1fd4

Please sign in to comment.