mirror of
https://github.com/reactos/reactos.git
synced 2025-04-19 04:07:16 +00:00
-avoid dereferencing of NULL pointers
svn path=/trunk/; revision=27473
This commit is contained in:
parent
7a7bdde4ec
commit
9be5d6e114
1 changed files with 10 additions and 1 deletions
|
@ -3087,6 +3087,9 @@ SpiAdapterControl(PDEVICE_OBJECT DeviceObject,
|
||||||
/* Build the actual SG list */
|
/* Build the actual SG list */
|
||||||
while (TotalLength < Srb->DataTransferLength)
|
while (TotalLength < Srb->DataTransferLength)
|
||||||
{
|
{
|
||||||
|
if (!ScatterGatherList)
|
||||||
|
break;
|
||||||
|
|
||||||
ScatterGatherList->Length = Srb->DataTransferLength - TotalLength;
|
ScatterGatherList->Length = Srb->DataTransferLength - TotalLength;
|
||||||
ScatterGatherList->PhysicalAddress = IoMapTransfer(DeviceExtension->AdapterObject,
|
ScatterGatherList->PhysicalAddress = IoMapTransfer(DeviceExtension->AdapterObject,
|
||||||
Irp->MdlAddress,
|
Irp->MdlAddress,
|
||||||
|
@ -3649,7 +3652,7 @@ SpiScanAdapter(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension)
|
||||||
/* Scan all logical units */
|
/* Scan all logical units */
|
||||||
for (Lun = 0; Lun < SCSI_MAXIMUM_LOGICAL_UNITS; Lun++)
|
for (Lun = 0; Lun < SCSI_MAXIMUM_LOGICAL_UNITS; Lun++)
|
||||||
{
|
{
|
||||||
if (!LunExtension)
|
if ((!LunExtension) || (!LunInfo))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Add extension to the list */
|
/* Add extension to the list */
|
||||||
|
@ -3935,6 +3938,12 @@ SpiSendRequestSense(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension,
|
||||||
TRUE,
|
TRUE,
|
||||||
TRUE);
|
TRUE);
|
||||||
|
|
||||||
|
if (!Srb)
|
||||||
|
{
|
||||||
|
DPRINT("SpiSendRequestSense() failed, Srb %p\n", Srb);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
IrpStack = IoGetNextIrpStackLocation(Irp);
|
IrpStack = IoGetNextIrpStackLocation(Irp);
|
||||||
IrpStack->MajorFunction = IRP_MJ_SCSI;
|
IrpStack->MajorFunction = IRP_MJ_SCSI;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue