Author: fireball
Date: Sun Dec 14 05:59:21 2008
New Revision: 38076
URL: http://svn.reactos.org/svn/reactos?rev=38076&view=rev
Log:
- Undo one "fix" from 38075. Coverity warned you about possible double check of the same pointer (though in || you probably can't go without it), but one check should definately stay! SpiGetLunExtension can return NULL!
Modified:
trunk/reactos/drivers/storage/scsiport/scsiport.c
Modified: trunk/reactos/drivers/storage/scsiport/scsiport.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport/s…
==============================================================================
--- trunk/reactos/drivers/storage/scsiport/scsiport.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/scsiport/scsiport.c [iso-8859-1] Sun Dec 14 05:59:21 2008
@@ -1956,6 +1956,9 @@
PathId,
TargetId,
Lun);
+
+ /* If returned LunExtension is NULL, break out */
+ if (!LunExtension) break;
/* This request should not be processed if */
if ((LunExtension->ReadyLun) ||
Author: sginsberg
Date: Sun Dec 14 04:15:49 2008
New Revision: 38075
URL: http://svn.reactos.org/svn/reactos?rev=38075&view=rev
Log:
- Fix a broken loop
- Remove unnecessary checks
- Fixes CID 171, 172 and 655
Modified:
trunk/reactos/drivers/storage/scsiport/scsiport.c
Modified: trunk/reactos/drivers/storage/scsiport/scsiport.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport/s…
==============================================================================
--- trunk/reactos/drivers/storage/scsiport/scsiport.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/scsiport/scsiport.c [iso-8859-1] Sun Dec 14 04:15:49 2008
@@ -1733,7 +1733,7 @@
LunInfo = DeviceExtension->BusesConfig->BusScanInfo[Bus]->LunInfo;
- while (!LunInfo)
+ while (LunInfo)
{
/* Free current, but save pointer to the next one */
Ptr = LunInfo->Next;
@@ -1958,8 +1958,8 @@
Lun);
/* This request should not be processed if */
- if ((LunExtension && LunExtension->ReadyLun) ||
- (LunExtension && LunExtension->SrbInfo.Srb))
+ if ((LunExtension->ReadyLun) ||
+ (LunExtension->SrbInfo.Srb))
{
/* Nothing to do here */
break;
@@ -2900,7 +2900,7 @@
// Store the MDL virtual address in SrbInfo structure
SrbInfo->DataOffset = MmGetMdlVirtualAddress(Irp->MdlAddress);
- if (DeviceExtension->MapBuffers && Irp->MdlAddress)
+ if (DeviceExtension->MapBuffers)
{
/* Calculate offset within DataBuffer */
SrbInfo->DataOffset = MmGetSystemAddressForMdl(Irp->MdlAddress);