\r
// Build Portmap\r
gaPCI_PortBitmap = malloc( 1 << 13 );\r
+ if( !gaPCI_PortBitmap ) {\r
+ Log_Error("PCI", "Unable to allocate %i bytes for bitmap", 1 << 13);\r
+ return MODULE_ERR_MALLOC;\r
+ }\r
memset( gaPCI_PortBitmap, 0, 1 << 13 );\r
for( i = 0; i < MAX_RESERVED_PORT / 32; i ++ )\r
gaPCI_PortBitmap[i] = -1;\r
space += SPACE_STEP;\r
tmpPtr = realloc(gPCI_Devices, space*sizeof(tPCIDevice));\r
if(tmpPtr == NULL)\r
- break;\r
+ return MODULE_ERR_MALLOC;\r
gPCI_Devices = tmpPtr;\r
}\r
if(devInfo.oc == PCI_OC_PCIBRIDGE)\r
break;\r
}\r
}\r
- if(tmpPtr != gPCI_Devices)\r
- break;\r
}\r
- if(tmpPtr != gPCI_Devices)\r
- break;\r
}\r
\r
- if(giPCI_DeviceCount == 0)\r
+ if(giPCI_DeviceCount == 0) {\r
+ Log_Notice("PCI", "No devices were found");\r
return MODULE_ERR_NOTNEEDED;\r
+ }\r
\r
tmpPtr = realloc(gPCI_Devices, giPCI_DeviceCount*sizeof(tPCIDevice));\r
if(tmpPtr == NULL)\r