Skip to content

Commit

Permalink
fix coverity issue for Boot in kernelflinger - 2
Browse files Browse the repository at this point in the history
Test Done:
boot/reboot several times work normally

Tracked-On: OAM-126533
Signed-off-by: Zhao, Shirley <[email protected]>
  • Loading branch information
xyzhao2018 committed Oct 21, 2024
1 parent 953f01f commit 15a24d3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions libadb/reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,6 @@ static EFI_STATUS vmcore_build_header(reader_ctx_t *ctx, void *priv_p)

if (priv->m.end && end > priv->m.end) {
length -= end - priv->m.end;
end = priv->m.end;
}

priv->hdr.phnum++;
Expand Down Expand Up @@ -581,7 +580,7 @@ static EFI_STATUS vmcore_read(reader_ctx_t *ctx, unsigned char **buf, UINT64 *le

/* Start new memory region */
if (priv->m.cur == priv->m.cur_end) {
if (priv->cur_phdr == priv->hdr.phnum - 1) {
if (priv->cur_phdr >= priv->hdr.phnum - 1) {
error(L"Invalid parameter in %a", __func__);
return EFI_INVALID_PARAMETER;
}
Expand Down
2 changes: 2 additions & 0 deletions libfastboot/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,10 +659,12 @@ EFI_STATUS erase_by_label(CHAR16 *label)
if (!CompareGuid(&p_gparti->part.type, &EfiPartTypeSystemPartitionGuid))
return gpt_refresh();

#ifdef USER
if (is_data)
userdata_erased = TRUE;
if (is_share_data)
share_data_erased = TRUE;
#endif

return EFI_SUCCESS;
}
Expand Down
2 changes: 1 addition & 1 deletion libkernelflinger/fatfs/source/ff.c
Original file line number Diff line number Diff line change
Expand Up @@ -5171,7 +5171,7 @@ FRESULT f_mkdir (
res = sync_fs(fs);
}
} else {
remove_chain(&sobj, dcl, 0); /* Could not register, remove the allocated cluster */
res = remove_chain(&sobj, dcl, 0); /* Could not register, remove the allocated cluster */
}
}
FREE_NAMBUF();
Expand Down

0 comments on commit 15a24d3

Please sign in to comment.