From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56975 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OrB2O-0002pc-Uj for qemu-devel@nongnu.org; Thu, 02 Sep 2010 10:45:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OrB2M-0006jT-9e for qemu-devel@nongnu.org; Thu, 02 Sep 2010 10:45:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57034) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OrB2L-0006j6-Ub for qemu-devel@nongnu.org; Thu, 02 Sep 2010 10:45:10 -0400 Message-ID: <4C7FB881.7090502@redhat.com> Date: Thu, 02 Sep 2010 16:45:21 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] lsi53c895a: avoid calling a NULL function References: <1283434657-12843-1-git-send-email-bernhard.kohl@nsn.com> In-Reply-To: <1283434657-12843-1-git-send-email-bernhard.kohl@nsn.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bernhard Kohl Cc: qemu-devel@nongnu.org Am 02.09.2010 15:37, schrieb Bernhard Kohl: > In scsi-generic the reset() function is not available. > > Signed-off-by: Bernhard Kohl > --- > 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