mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 02:05:01 +00:00
vboot: Remove LoadKernel() LBA size/count checks
Now that LoadKernel() uses a stream API for its partition data, it doesn't care about those fields. They're blindly passed to cgptlib_internal, which does similar checks in CheckParameters() and CheckHeader(). So, don't duplicate the checks. BUG=chromium:611535 BRANCH=none TEST=make runtests; emerge-kevin coreboot depthcharge Change-Id: I72375496e5df7b7c17df25d358f2555fe41fe520 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/407053 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
f182401b97
commit
eedd429358
@@ -435,13 +435,6 @@ VbError_t LoadKernel(LoadKernelParams *params, VbCommonParams *cparams)
|
|||||||
VbError_t retval = VBERROR_UNKNOWN;
|
VbError_t retval = VBERROR_UNKNOWN;
|
||||||
int recovery = VBNV_RECOVERY_LK_UNSPECIFIED;
|
int recovery = VBNV_RECOVERY_LK_UNSPECIFIED;
|
||||||
|
|
||||||
/* Sanity Checks */
|
|
||||||
if (!params->bytes_per_lba || !params->streaming_lba_count) {
|
|
||||||
VB2_DEBUG("LoadKernel() called with invalid params\n");
|
|
||||||
retval = VBERROR_INVALID_PARAMETER;
|
|
||||||
goto load_kernel_exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Clear output params in case we fail */
|
/* Clear output params in case we fail */
|
||||||
params->partition_number = 0;
|
params->partition_number = 0;
|
||||||
params->bootloader_address = 0;
|
params->bootloader_address = 0;
|
||||||
@@ -673,17 +666,11 @@ load_kernel_exit:
|
|||||||
VBERROR_SUCCESS != retval ?
|
VBERROR_SUCCESS != retval ?
|
||||||
recovery : VBNV_RECOVERY_NOT_REQUESTED);
|
recovery : VBNV_RECOVERY_NOT_REQUESTED);
|
||||||
|
|
||||||
/*
|
|
||||||
* If LoadKernel() was called with bad parameters, shcall may not be
|
|
||||||
* initialized.
|
|
||||||
*/
|
|
||||||
if (shcall)
|
|
||||||
shcall->return_code = (uint8_t)retval;
|
|
||||||
|
|
||||||
/* Store how much shared data we used, if any */
|
/* Store how much shared data we used, if any */
|
||||||
cparams->shared_data_size = shared->data_used;
|
cparams->shared_data_size = shared->data_used;
|
||||||
|
|
||||||
free(recovery_key);
|
free(recovery_key);
|
||||||
|
|
||||||
|
shcall->return_code = (uint8_t)retval;
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -569,16 +569,6 @@ static void ReadWriteGptTest(void)
|
|||||||
*/
|
*/
|
||||||
static void InvalidParamsTest(void)
|
static void InvalidParamsTest(void)
|
||||||
{
|
{
|
||||||
ResetMocks();
|
|
||||||
lkp.bytes_per_lba = 0;
|
|
||||||
TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_PARAMETER,
|
|
||||||
"Bad lba size");
|
|
||||||
|
|
||||||
ResetMocks();
|
|
||||||
lkp.streaming_lba_count = 0;
|
|
||||||
TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_INVALID_PARAMETER,
|
|
||||||
"Bad lba count");
|
|
||||||
|
|
||||||
ResetMocks();
|
ResetMocks();
|
||||||
gpt_init_fail = 1;
|
gpt_init_fail = 1;
|
||||||
TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_NO_KERNEL_FOUND,
|
TEST_EQ(LoadKernel(&lkp, &cparams), VBERROR_NO_KERNEL_FOUND,
|
||||||
|
|||||||
Reference in New Issue
Block a user