diff options
Diffstat (limited to 'src/northbridge/amd')
-rw-r--r-- | src/northbridge/amd/pi/00630F01/dimmSpd.c | 6 | ||||
-rw-r--r-- | src/northbridge/amd/pi/00660F01/dimmSpd.c | 7 | ||||
-rw-r--r-- | src/northbridge/amd/pi/00730F01/dimmSpd.c | 6 |
3 files changed, 16 insertions, 3 deletions
diff --git a/src/northbridge/amd/pi/00630F01/dimmSpd.c b/src/northbridge/amd/pi/00630F01/dimmSpd.c index f958b01b3c..845dad19a0 100644 --- a/src/northbridge/amd/pi/00630F01/dimmSpd.c +++ b/src/northbridge/amd/pi/00630F01/dimmSpd.c @@ -28,9 +28,13 @@ AGESA_STATUS AmdMemoryReadSPD (UINT32 unused1, UINTN unused2, AGESA_READ_SPD_PAR { int spdAddress; DEVTREE_CONST struct device *dev = pcidev_on_root(0x18, 2); + + if (dev == NULL) + return AGESA_ERROR; + DEVTREE_CONST struct northbridge_amd_pi_00630F01_config *config = dev->chip_info; - if ((dev == 0) || (config == 0)) + if (config == NULL) return AGESA_ERROR; if (info->SocketId >= ARRAY_SIZE(config->spdAddrLookup)) diff --git a/src/northbridge/amd/pi/00660F01/dimmSpd.c b/src/northbridge/amd/pi/00660F01/dimmSpd.c index 0de7654532..349dacf4f4 100644 --- a/src/northbridge/amd/pi/00660F01/dimmSpd.c +++ b/src/northbridge/amd/pi/00660F01/dimmSpd.c @@ -27,10 +27,15 @@ AGESA_STATUS AmdMemoryReadSPD (UINT32 unused1, UINTN unused2, AGESA_READ_SPD_PAR { int spdAddress; DEVTREE_CONST struct device *dev = pcidev_on_root(0x18, 2); + + if (dev == NULL) + return AGESA_ERROR; + DEVTREE_CONST struct northbridge_amd_pi_00660F01_config *config = dev->chip_info; - if ((dev == 0) || (config == 0)) + if (config == NULL) return AGESA_ERROR; + if (info->SocketId >= ARRAY_SIZE(config->spdAddrLookup)) return AGESA_ERROR; if (info->MemChannelId >= ARRAY_SIZE(config->spdAddrLookup[0])) diff --git a/src/northbridge/amd/pi/00730F01/dimmSpd.c b/src/northbridge/amd/pi/00730F01/dimmSpd.c index 79e046e3e4..bbcac9079f 100644 --- a/src/northbridge/amd/pi/00730F01/dimmSpd.c +++ b/src/northbridge/amd/pi/00730F01/dimmSpd.c @@ -28,9 +28,13 @@ AGESA_STATUS AmdMemoryReadSPD (UINT32 unused1, UINTN unused2, AGESA_READ_SPD_PAR { int spdAddress; DEVTREE_CONST struct device *dev = pcidev_on_root(0x18, 2); + + if (dev == NULL) + return AGESA_ERROR; + DEVTREE_CONST struct northbridge_amd_pi_00730F01_config *config = dev->chip_info; - if ((dev == 0) || (config == 0)) + if (config == NULL) return AGESA_ERROR; if (info->SocketId >= ARRAY_SIZE(config->spdAddrLookup)) |