[v2,5/5] migration: Missing rcu_read_unlock
diff mbox series

Message ID 20190911190622.7629-6-dgilbert@redhat.com
State New
Headers show
Series
  • Automatic RCU read unlock
Related show

Commit Message

Dr. David Alan Gilbert Sept. 11, 2019, 7:06 p.m. UTC
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

Error path missing an unlock.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 migration/ram.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Daniel P. Berrangé Sept. 12, 2019, 9:38 a.m. UTC | #1
On Wed, Sep 11, 2019 at 08:06:22PM +0100, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> Error path missing an unlock.
> 
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
>  migration/ram.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
Paolo Bonzini Sept. 12, 2019, 12:32 p.m. UTC | #2
On 11/09/19 21:06, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> Error path missing an unlock.
> 
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
>  migration/ram.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/migration/ram.c b/migration/ram.c
> index 1bb82acfe0..977172ea7e 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -3445,6 +3445,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
>      RAMBLOCK_FOREACH_MIGRATABLE(block) {
>          if (!block->idstr[0]) {
>              error_report("%s: RAMBlock with empty name", __func__);
> +            rcu_read_unlock();
>              return -1;
>          }
>          qemu_put_byte(f, strlen(block->idstr));
> 

(The scoped version would be useful here).

Paolo

Patch
diff mbox series

diff --git a/migration/ram.c b/migration/ram.c
index 1bb82acfe0..977172ea7e 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -3445,6 +3445,7 @@  static int ram_save_setup(QEMUFile *f, void *opaque)
     RAMBLOCK_FOREACH_MIGRATABLE(block) {
         if (!block->idstr[0]) {
             error_report("%s: RAMBlock with empty name", __func__);
+            rcu_read_unlock();
             return -1;
         }
         qemu_put_byte(f, strlen(block->idstr));