Patchwork lance: unbreak after memory API conversion

login
register
mail settings
Submitter Avi Kivity
Date Aug. 9, 2011, 6:54 a.m.
Message ID <1312872862-30933-1-git-send-email-avi@redhat.com>
Download mbox | patch
Permalink /patch/109140/
State New
Headers show

Comments

Avi Kivity - Aug. 9, 2011, 6:54 a.m.
The conversion passed the wrong opaque pointer, causing a crash on first use.
Pass the correct opaque.

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 hw/lance.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Edgar Iglesias - Aug. 9, 2011, 7:01 a.m.
On Tue, Aug 09, 2011 at 09:54:22AM +0300, Avi Kivity wrote:
> The conversion passed the wrong opaque pointer, causing a crash on first use.
> Pass the correct opaque.

I've applied this, thanks.


> 
> Signed-off-by: Avi Kivity <avi@redhat.com>
> ---
>  hw/lance.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/lance.c b/hw/lance.c
> index 8e20360..d83e7f5 100644
> --- a/hw/lance.c
> +++ b/hw/lance.c
> @@ -116,7 +116,7 @@ static int lance_init(SysBusDevice *dev)
>      SysBusPCNetState *d = FROM_SYSBUS(SysBusPCNetState, dev);
>      PCNetState *s = &d->state;
>  
> -    memory_region_init_io(&s->mmio, &lance_mem_ops, s, "lance-mmio", 4);
> +    memory_region_init_io(&s->mmio, &lance_mem_ops, d, "lance-mmio", 4);
>  
>      qdev_init_gpio_in(&dev->qdev, parent_lance_reset, 1);
>  
> -- 
> 1.7.5.3
> 
>

Patch

diff --git a/hw/lance.c b/hw/lance.c
index 8e20360..d83e7f5 100644
--- a/hw/lance.c
+++ b/hw/lance.c
@@ -116,7 +116,7 @@  static int lance_init(SysBusDevice *dev)
     SysBusPCNetState *d = FROM_SYSBUS(SysBusPCNetState, dev);
     PCNetState *s = &d->state;
 
-    memory_region_init_io(&s->mmio, &lance_mem_ops, s, "lance-mmio", 4);
+    memory_region_init_io(&s->mmio, &lance_mem_ops, d, "lance-mmio", 4);
 
     qdev_init_gpio_in(&dev->qdev, parent_lance_reset, 1);