From bdd185a355c15a6f18c11cf173cdeb4f599059a6 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Sun, 22 Feb 2015 17:54:18 +0100 Subject: amd/sb600: Fix NULL test after use issue Change-Id: Icecbcc1dee837ecfe0dd52bade3b83fdcdd15bad Signed-off-by: Patrick Georgi Found-by: Coverity Scan Reviewed-on: http://review.coreboot.org/8513 Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc Reviewed-by: Paul Menzel --- src/southbridge/amd/sb600/hda.c | 4 ++-- 1 file 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; -- cgit v1.2.3