Fixed potential NULL pointer dereferences in the CD-ROM and Iomega ZIP codes.

This commit is contained in:
OBattler
2020-01-15 02:18:28 +01:00
parent 9f9883f8da
commit 1464c0631b
2 changed files with 4 additions and 2 deletions

View File

@@ -866,7 +866,8 @@ zip_bus_speed(zip_t *dev)
if (dev && dev->drv)
ret = ide_atapi_get_period(dev->drv->ide_channel);
if (ret == -1.0) {
dev->callback = -1.0;
if (dev)
dev->callback = -1.0;
return 0.0;
} else
return ret * 1000000.0;

View File

@@ -613,7 +613,8 @@ scsi_cdrom_bus_speed(scsi_cdrom_t *dev)
if (dev && dev->drv)
ret = ide_atapi_get_period(dev->drv->ide_channel);
if (ret == -1.0) {
dev->callback = -1.0;
if (dev)
dev->callback = -1.0;
return 0.0;
} else
return ret * 1000000.0;