diff mbox series

migration: Unlock mutex in error case

Message ID 20231102091245.42045-1-quintela@redhat.com
State New
Headers show
Series migration: Unlock mutex in error case | expand

Commit Message

Juan Quintela Nov. 2, 2023, 9:12 a.m. UTC
We were not unlocking bitmap mutex on the error case.
Coverity discovered the problem.

Fixes: a2326705e5 ("migration: Stop migration immediately in RDMA error paths")
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/ram.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Peter Maydell Nov. 2, 2023, 12:50 p.m. UTC | #1
On Thu, 2 Nov 2023 at 09:13, Juan Quintela <quintela@redhat.com> wrote:
>
> We were not unlocking bitmap mutex on the error case.
> Coverity discovered the problem.
>
> Fixes: a2326705e5 ("migration: Stop migration immediately in RDMA error paths")
> Signed-off-by: Juan Quintela <quintela@redhat.com>

CID 1523750.

thanks
-- PMM
Peter Xu Nov. 2, 2023, 1:41 p.m. UTC | #2
On Thu, Nov 02, 2023 at 10:12:45AM +0100, Juan Quintela wrote:
> We were not unlocking bitmap mutex on the error case.
> Coverity discovered the problem.
> 
> Fixes: a2326705e5 ("migration: Stop migration immediately in RDMA error paths")
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>  migration/ram.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/migration/ram.c b/migration/ram.c
> index 34724e8fe8..8c4df60f29 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -3040,6 +3040,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
>          ret = rdma_registration_start(f, RAM_CONTROL_ROUND);
>          if (ret < 0) {
>              qemu_file_set_error(f, ret);
> +            qemu_mutex_unlock(&rs->bitmap_mutex);
>              goto out;
>          }

Reviewed-by: Peter Xu <peterx@redhat.com>
diff mbox series

Patch

diff --git a/migration/ram.c b/migration/ram.c
index 34724e8fe8..8c4df60f29 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -3040,6 +3040,7 @@  static int ram_save_iterate(QEMUFile *f, void *opaque)
         ret = rdma_registration_start(f, RAM_CONTROL_ROUND);
         if (ret < 0) {
             qemu_file_set_error(f, ret);
+            qemu_mutex_unlock(&rs->bitmap_mutex);
             goto out;
         }