lsi53c895a: avoid calling a NULL function
PATCH 1/1 lsi53c895a: avoid calling a NULL function
In scsi-generic the reset() function is not available.
--- hw/lsi53c895a.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
hw/lsi53c895a.c +3 -1
@@ -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 ;
Signature · 1 line
1.7.2.2
Am 02.09.2010 15:37, schrieb Bernhard Kohl:
Quoted 12 lines
In scsi-generic the
reset()function is not available.Signed-off-by Bernhard Kohl <[email protected]>--- hw/lsi53c895a.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)hw/lsi53c895a.c +0
-0
hw/lsi53c895a.c static void lsi_reg_writeb(LSIState *s, int offset, uint8_t val) · line 1605
Quoted 10 lines
hw/lsi53c895a.c +3
-1@@ -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
Am 02.09.2010 16:45, schrieb ext Kevin Wolf:
Quoted 4 lines
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 ine9447f35.
Yes, I agree. Let's skip this patch. I'll send another one.
Bernhard