summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@georgi-clan.de>2015-02-22 17:54:18 +0100
committerPatrick Georgi <pgeorgi@google.com>2015-02-25 14:05:42 +0100
commitbdd185a355c15a6f18c11cf173cdeb4f599059a6 (patch)
tree8e799f277fb8273bd2baf179b6d01ef828729685
parent6529c33a67b180d961e16abb5d8fd337930da946 (diff)
amd/sb600: Fix NULL test after use issue
Change-Id: Icecbcc1dee837ecfe0dd52bade3b83fdcdd15bad Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Found-by: Coverity Scan Reviewed-on: http://review.coreboot.org/8513 Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
-rw-r--r--src/southbridge/amd/sb600/hda.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/southbridge/amd/sb600/hda.c b/src/southbridge/amd/sb600/hda.c
index de7a31913f..9706289999 100644
--- a/src/southbridge/amd/sb600/hda.c
+++ b/src/southbridge/amd/sb600/hda.c
@@ -157,11 +157,11 @@ static u32 find_verb(u32 viddid, u32 ** verb)
device_t azalia_dev = dev_find_slot(0, PCI_DEVFN(0x14, 2));
struct southbridge_amd_sb600_config *cfg =
(struct southbridge_amd_sb600_config *)azalia_dev->chip_info;
+ if (!cfg)
+ return 0;
printk(BIOS_DEBUG, "Dev=%s\n", dev_path(azalia_dev));
printk(BIOS_DEBUG, "Default viddid=%x\n", cfg->hda_viddid);
printk(BIOS_DEBUG, "Reading viddid=%x\n", viddid);
- if (!cfg)
- return 0;
if (viddid != cfg->hda_viddid)
return 0;
*verb = (u32 *) cim_verb_data;