Fixed potential NULL pointer dereferences in the CD-ROM and Iomega ZIP codes.
This commit is contained in:
@@ -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;
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user