Commit 0d6d8807793e74402e23772062469aeb4808dd48
1 parent
87a19df5e4
Exists in
smarc_8mm-imx_v2018.03_4.14.98_2.0.0_ga
and in
4 other branches
MA-14629 fix build warnings for varialbe initialization and type cast
initialize potential uninitialized variable with the type of"char*" to be NULL in AVB. That "hashtree_error_mode" in code is manually specified with a known value, the cases listed cover all potential value of "hashtree_error_mode" explicitly do a type cast for memcpy parameters. Change-Id: Ie5d234422a273d6dab75585bd0d8eb81583707ca Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
Showing 2 changed files with 3 additions and 3 deletions Side-by-side Diff
board/freescale/imx8qm_mek/imx8qm_mek.c
... | ... | @@ -570,7 +570,7 @@ |
570 | 570 | end_of_uboot += 9; |
571 | 571 | |
572 | 572 | /* load hdmitxfw.bin and hdmirxfw.bin*/ |
573 | - memcpy(IMX_HDMI_FIRMWARE_LOAD_ADDR, end_of_uboot, | |
573 | + memcpy((void *)IMX_HDMI_FIRMWARE_LOAD_ADDR, end_of_uboot, | |
574 | 574 | IMX_HDMITX_FIRMWARE_SIZE + IMX_HDMIRX_FIRMWARE_SIZE); |
575 | 575 | |
576 | 576 | sprintf(command, "hdp load 0x%x", IMX_HDMI_FIRMWARE_LOAD_ADDR); |
lib/avb/libavb/avb_cmdline.c
... | ... | @@ -222,7 +222,7 @@ |
222 | 222 | AvbAlgorithmType algorithm_type, |
223 | 223 | AvbHashtreeErrorMode hashtree_error_mode) { |
224 | 224 | AvbSlotVerifyResult ret; |
225 | - const char* verity_mode; | |
225 | + const char* verity_mode = NULL; | |
226 | 226 | bool is_device_unlocked; |
227 | 227 | AvbIOResult io_ret; |
228 | 228 | |
... | ... | @@ -320,7 +320,7 @@ |
320 | 320 | if (toplevel_vbmeta->flags & AVB_VBMETA_IMAGE_FLAGS_HASHTREE_DISABLED) { |
321 | 321 | verity_mode = "disabled"; |
322 | 322 | } else { |
323 | - const char* dm_verity_mode; | |
323 | + const char* dm_verity_mode = NULL; | |
324 | 324 | char* new_ret; |
325 | 325 | |
326 | 326 | switch (hashtree_error_mode) { |