soc/intel/skylake: check for NULL with if condition
This patch removes assert() and checks if the dev is NULL with "if" condition only. Found-by: klockwork Change-Id: Icd2c8490c8bda14ecd752437d463a7110fe40aea Signed-off-by: Pratik Prajapati <pratikkumar.v.prajapati@intel.com> Reviewed-on: https://review.coreboot.org/28888 Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
4f6eccdcac
commit
645064a59e
|
@ -547,9 +547,14 @@ void cpu_lock_sgx_memory(void)
|
||||||
int soc_fill_sgx_param(struct sgx_param *sgx_param)
|
int soc_fill_sgx_param(struct sgx_param *sgx_param)
|
||||||
{
|
{
|
||||||
struct device *dev = SA_DEV_ROOT;
|
struct device *dev = SA_DEV_ROOT;
|
||||||
assert(dev != NULL);
|
config_t *conf;
|
||||||
config_t *conf = dev->chip_info;
|
|
||||||
|
|
||||||
|
if (!dev) {
|
||||||
|
printk(BIOS_ERR, "Failed to get root dev for checking SGX param\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
conf = dev->chip_info;
|
||||||
if (!conf) {
|
if (!conf) {
|
||||||
printk(BIOS_ERR, "Failed to get chip_info for SGX param\n");
|
printk(BIOS_ERR, "Failed to get chip_info for SGX param\n");
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -561,9 +566,14 @@ int soc_fill_sgx_param(struct sgx_param *sgx_param)
|
||||||
int soc_fill_vmx_param(struct vmx_param *vmx_param)
|
int soc_fill_vmx_param(struct vmx_param *vmx_param)
|
||||||
{
|
{
|
||||||
struct device *dev = SA_DEV_ROOT;
|
struct device *dev = SA_DEV_ROOT;
|
||||||
assert(dev != NULL);
|
config_t *conf;
|
||||||
config_t *conf = dev->chip_info;
|
|
||||||
|
|
||||||
|
if (!dev) {
|
||||||
|
printk(BIOS_ERR, "Failed to get root dev for checking VMX param\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
conf = dev->chip_info;
|
||||||
if (!conf) {
|
if (!conf) {
|
||||||
printk(BIOS_ERR, "Failed to get chip_info for VMX param\n");
|
printk(BIOS_ERR, "Failed to get chip_info for VMX param\n");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue