-fix a memory leak

-don't use uninitialized memory

svn path=/trunk/; revision=27443
This commit is contained in:
Christoph von Wittich 2007-07-07 01:39:19 +00:00
parent 733237f1ad
commit 320491c5f1

View file

@ -68,6 +68,7 @@ static NTSTATUS STDCALL
ScsiPortCreateClose(IN PDEVICE_OBJECT DeviceObject, ScsiPortCreateClose(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp); IN PIRP Irp);
static DRIVER_DISPATCH ScsiPortDispatchScsi;
static NTSTATUS STDCALL static NTSTATUS STDCALL
ScsiPortDispatchScsi(IN PDEVICE_OBJECT DeviceObject, ScsiPortDispatchScsi(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp); IN PIRP Irp);
@ -76,6 +77,7 @@ static NTSTATUS STDCALL
ScsiPortDeviceControl(IN PDEVICE_OBJECT DeviceObject, ScsiPortDeviceControl(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp); IN PIRP Irp);
static DRIVER_STARTIO ScsiPortStartIo;
static VOID STDCALL static VOID STDCALL
ScsiPortStartIo(IN PDEVICE_OBJECT DeviceObject, ScsiPortStartIo(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp); IN PIRP Irp);
@ -111,6 +113,7 @@ SpiGetSrbData(IN PVOID DeviceExtension,
IN UCHAR Lun, IN UCHAR Lun,
IN UCHAR QueueTag); IN UCHAR QueueTag);
static KSERVICE_ROUTINE ScsiPortIsr;
static BOOLEAN STDCALL static BOOLEAN STDCALL
ScsiPortIsr(IN PKINTERRUPT Interrupt, ScsiPortIsr(IN PKINTERRUPT Interrupt,
IN PVOID ServiceContext); IN PVOID ServiceContext);
@ -136,6 +139,7 @@ static VOID
SpiSendRequestSense(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, SpiSendRequestSense(IN PSCSI_PORT_DEVICE_EXTENSION DeviceExtension,
IN PSCSI_REQUEST_BLOCK Srb); IN PSCSI_REQUEST_BLOCK Srb);
static IO_COMPLETION_ROUTINE SpiCompletionRoutine;
NTSTATUS STDCALL NTSTATUS STDCALL
SpiCompletionRoutine(PDEVICE_OBJECT DeviceObject, SpiCompletionRoutine(PDEVICE_OBJECT DeviceObject,
PIRP Irp, PIRP Irp,
@ -2063,6 +2067,7 @@ SpiGetPciConfigData(IN PDRIVER_OBJECT DriverObject,
DPRINT ("SpiGetPciConfiguration() called\n"); DPRINT ("SpiGetPciConfiguration() called\n");
RtlZeroMemory(&ResourceList, sizeof(PCM_RESOURCE_LIST));
SlotNumber.u.AsULONG = 0; SlotNumber.u.AsULONG = 0;
/* Loop through all devices */ /* Loop through all devices */
@ -3022,7 +3027,10 @@ SpiSendInquiry (IN PDEVICE_OBJECT DeviceObject,
SenseBuffer = ExAllocatePoolWithTag (NonPagedPool, SENSE_BUFFER_SIZE, TAG_SCSIPORT); SenseBuffer = ExAllocatePoolWithTag (NonPagedPool, SENSE_BUFFER_SIZE, TAG_SCSIPORT);
if (SenseBuffer == NULL) if (SenseBuffer == NULL)
{
ExFreePool(InquiryBuffer);
return STATUS_INSUFFICIENT_RESOURCES; return STATUS_INSUFFICIENT_RESOURCES;
}
while (KeepTrying) while (KeepTrying)
{ {
@ -4305,6 +4313,8 @@ ScsiPortDpcForIsr(IN PKDPC Dpc,
/* We need to acquire spinlock */ /* We need to acquire spinlock */
KeAcquireSpinLockAtDpcLevel(&DeviceExtension->SpinLock); KeAcquireSpinLockAtDpcLevel(&DeviceExtension->SpinLock);
RtlZeroMemory(&InterruptData, sizeof(SCSI_PORT_INTERRUPT_DATA));
TryAgain: TryAgain:
/* Interrupt structure must be snapshotted, and only then analyzed */ /* Interrupt structure must be snapshotted, and only then analyzed */