[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] lsi53c895a: avoid calling a NULL function
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH] lsi53c895a: avoid calling a NULL function |
Date: |
Thu, 02 Sep 2010 16:45:21 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100720 Fedora/3.0.6-1.fc12 Thunderbird/3.0.6 |
Am 02.09.2010 15:37, schrieb Bernhard Kohl:
> In scsi-generic the reset() function is not available.
>
> Signed-off-by: Bernhard Kohl <address@hidden>
> ---
> hw/lsi53c895a.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
> index 5eaf69e..01ff028 100644
> --- a/hw/lsi53c895a.c
> +++ b/hw/lsi53c895a.c
> @@ -1597,7 +1597,9 @@ static void lsi_reg_writeb(LSIState *s, int offset,
> uint8_t val)
> for (id = 0; id < s->bus.ndev; id++) {
> if (s->bus.devs[id]) {
> dev = &s->bus.devs[id]->qdev;
> - dev->info->reset(dev);
> + if (dev->info->reset) {
> + dev->info->reset(dev);
> + }
> }
> }
> s->sstat0 |= LSI_SSTAT0_RST;
I suspect the real fix is to add a reset handler to scsi-generic. It
should probably remove the requests like it's currently done in
scsi_destroy. The same change was made for scsi-disk in e9447f35.
Kevin