arch/x86: Handle smm_subregion() failure

The callers don't necessarily check return value of
function. Make sure the parameters are not left
uninitialised in that case.

Change-Id: Ic02db2d35b2ec88506320e7df609940de4aef005
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34708
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Kyösti Mälkki 2019-08-05 15:13:53 +03:00
parent 14222d8678
commit d157b3e1e0
8 changed files with 16 additions and 0 deletions

View File

@ -130,6 +130,8 @@ int smm_subregion(int sub, uintptr_t *start, size_t *size)
clear_tvalid(); clear_tvalid();
break; break;
default: default:
*start = 0;
*size = 0;
return -1; return -1;
} }

View File

@ -130,6 +130,8 @@ int smm_subregion(int sub, uintptr_t *start, size_t *size)
clear_tvalid(); clear_tvalid();
break; break;
default: default:
*start = 0;
*size = 0;
return -1; return -1;
} }

View File

@ -68,6 +68,8 @@ int smm_subregion(int sub, uintptr_t *start, size_t *size)
sub_size = cache_size; sub_size = cache_size;
break; break;
default: default:
*start = 0;
*size = 0;
return -1; return -1;
} }

View File

@ -62,6 +62,8 @@ int smm_subregion(int sub, uintptr_t *start, size_t *size)
sub_size = cache_size; sub_size = cache_size;
break; break;
default: default:
*start = 0;
*size = 0;
return -1; return -1;
} }

View File

@ -72,6 +72,8 @@ int smm_subregion(int sub, uintptr_t *start, size_t *size)
sub_size = ied_size; sub_size = ied_size;
break; break;
default: default:
*start = 0;
*size = 0;
return -1; return -1;
} }

View File

@ -96,6 +96,8 @@ int smm_subregion(int sub, uintptr_t *start, size_t *size)
sub_size = cache_size; sub_size = cache_size;
break; break;
default: default:
*start = 0;
*size = 0;
return -1; return -1;
} }

View File

@ -70,6 +70,8 @@ int smm_subregion(int sub, uintptr_t *start, size_t *size)
sub_size = ied_size; sub_size = ied_size;
break; break;
default: default:
*start = 0;
*size = 0;
return -1; return -1;
} }

View File

@ -74,6 +74,8 @@ int smm_subregion(int sub, uintptr_t *start, size_t *size)
sub_size = ied_size; sub_size = ied_size;
break; break;
default: default:
*start = 0;
*size = 0;
return -1; return -1;
} }