New Defects reported by Coverity Scan for coreboot

scan-admin--- via coreboot <[email protected]>
Newsgroups gmane.linux.bios
Message-ID <[email protected]>
Hi,

Please find the latest report on new defect(s) introduced to coreboot found with Coverity Scan.

8 new defect(s) introduced to coreboot found with Coverity Scan.
32 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 8 of 8 defect(s)


** CID 1522885:    (CHECKED_RETURN)
/src/northbridge/intel/e7505/romstage.c: 17 in mainboard_romstage_entry()
/src/mainboard/emulation/qemu-i440fx/romstage.c: 8 in mainboard_romstage_entry()
/src/mainboard/emulation/qemu-q35/romstage.c: 17 in mainboard_romstage_entry()


________________________________________________________________________________________________________
*** CID 1522885:    (CHECKED_RETURN)
/src/northbridge/intel/e7505/romstage.c: 17 in mainboard_romstage_entry()
11     	/* FIXME: Keep until flashed bootblock has these. */
12     	i82801dx_early_init();
13     	i82801dx_lpc_setup();
14     
15     	sdram_initialize();
16     
>>>     CID 1522885:    (CHECKED_RETURN)
>>>     Calling "cbmem_recovery" without checking return value (as is done elsewhere 13 out of 16 times).
17     	cbmem_recovery(0);
/src/mainboard/emulation/qemu-i440fx/romstage.c: 8 in mainboard_romstage_entry()
2     
3     #include <arch/romstage.h>
4     #include <cbmem.h>
5     
6     void mainboard_romstage_entry(void)
7     {
>>>     CID 1522885:    (CHECKED_RETURN)
>>>     Calling "cbmem_recovery" without checking return value (as is done elsewhere 13 out of 16 times).
8     	cbmem_recovery(0);
/src/mainboard/emulation/qemu-q35/romstage.c: 17 in mainboard_romstage_entry()
11     {
12     	i82801ix_early_init();
13     
14     	if (!CONFIG(BOOTBLOCK_CONSOLE))
15     		mainboard_machine_check();
16     
>>>     CID 1522885:    (CHECKED_RETURN)
>>>     Calling "cbmem_recovery" without checking return value (as is done elsewhere 13 out of 16 times).
17     	cbmem_recovery(0);

** CID 1522884:  Control flow issues  (DEADCODE)
/src/security/vboot/vboot_logic.c: 192 in extend_pcrs()


________________________________________________________________________________________________________
*** CID 1522884:  Control flow issues  (DEADCODE)
/src/security/vboot/vboot_logic.c: 192 in extend_pcrs()
186     
187     static tpm_result_t extend_pcrs(struct vb2_context *ctx)
188     {
189     	tpm_result_t rc;
190     	rc = vboot_extend_pcr(ctx, CONFIG_PCR_BOOT_MODE, BOOT_MODE_PCR);
191     	if (rc)
>>>     CID 1522884:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach this statement: "return rc;".
192     		return rc;
193     	return vboot_extend_pcr(ctx, CONFIG_PCR_HWID, HWID_DIGEST_PCR);
194     }
195     
196     #define EC_EFS_BOOT_MODE_VERIFIED_RW	0x00
197     #define EC_EFS_BOOT_MODE_UNTRUSTED_RO	0x01

** CID 1522883:    (DEADCODE)
/src/soc/intel/common/block/graphics/graphics.c: 90 in get_external_display_status()
/src/soc/intel/common/block/graphics/graphics.c: 81 in get_external_display_status()


________________________________________________________________________________________________________
*** CID 1522883:    (DEADCODE)
/src/soc/intel/common/block/graphics/graphics.c: 90 in get_external_display_status()
84     			 * Dual display detected: both DDI-A(eDP) and
85     			 * DDI-B(HDMI) pipes are active
86     			 */
87     			return 1;
88     		} else {
89     			if (ddi_a_func_ctrl == TRANS_DDI_SELECT_PORT(PORT_A))
>>>     CID 1522883:    (DEADCODE)
>>>     Execution cannot reach this statement: "return 0;".
90     				return 0;
91     			else
92     				return 1;
93     		}
94     	}
95     }
/src/soc/intel/common/block/graphics/graphics.c: 81 in get_external_display_status()
75     	 * Check if transcoder is none or connected to DDI-A port (aka eDP).
76     	 * Report no external display in both cases.
77     	 */
78     	if (ddi_a_func_ctrl == TRANS_DDI_PORT_NONE) {
79     		return 0;
80     	} else {
>>>     CID 1522883:    (DEADCODE)
>>>     Execution cannot reach the expression "ddi_b_func_ctrl == 268435456U" inside this statement: "if (ddi_a_func_ctrl == 0U &...".
81     		if ((ddi_a_func_ctrl == TRANS_DDI_SELECT_PORT(PORT_A)) &&
82     			 (ddi_b_func_ctrl == TRANS_DDI_SELECT_PORT(PORT_B))) {
83     			/*
84     			 * Dual display detected: both DDI-A(eDP) and
85     			 * DDI-B(HDMI) pipes are active
86     			 */

** CID 1522882:  Control flow issues  (UNREACHABLE)
/src/mainboard/google/brya/variants/pirrha/variant.c: 12 in variant_generate_s0ix_hook()


________________________________________________________________________________________________________
*** CID 1522882:  Control flow issues  (UNREACHABLE)
/src/mainboard/google/brya/variants/pirrha/variant.c: 12 in variant_generate_s0ix_hook()
6     #include <acpi/acpigen.h>
7     
8     void variant_generate_s0ix_hook(enum s0ix_entry entry)
9     {
10     	return;
11     
>>>     CID 1522882:  Control flow issues  (UNREACHABLE)
>>>     This code cannot be reached: "if (entry == S0IX_ENTRY)
  ...".
12     	if (entry == S0IX_ENTRY)
13     		acpigen_soc_clear_tx_gpio(SD_CARD_POWER);
14     	else if (entry == S0IX_EXIT)
15     		acpigen_soc_set_tx_gpio(SD_CARD_POWER);

** CID 1522881:  Error handling issues  (CHECKED_RETURN)
/src/northbridge/intel/i945/gma.c: 102 in intel_gma_init_lvds()


________________________________________________________________________________________________________
*** CID 1522881:  Error handling issues  (CHECKED_RETURN)
/src/northbridge/intel/i945/gma.c: 102 in intel_gma_init_lvds()
96     	printk(BIOS_SPEW,
97     	       "i915lightup: graphics %p mmio %p addrport %04x physbase %08x\n",
98     	       (void *)pgfx, mmiobase, piobase, pphysbase);
99     
100     	intel_gmbus_read_edid(mmiobase + GMBUS0, GMBUS_PORT_PANEL, 0x50,
101     			edid_data, sizeof(edid_data));
>>>     CID 1522881:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "decode_edid" without checking return value (as is done elsewhere 10 out of 11 times).
102     	decode_edid(edid_data, sizeof(edid_data), &edid);
103     	mode = &edid.mode;
104     
105     	hpolarity = (mode->phsync == '-');
106     	vpolarity = (mode->pvsync == '-');
107     	hactive = edid.x_resolution;

** CID 1522880:  Resource leaks  (RESOURCE_LEAK)
/util/cbfstool/cbfs-mkstage.c: 431 in parse_elf_to_xip_stage()


________________________________________________________________________________________________________
*** CID 1522880:  Resource leaks  (RESOURCE_LEAK)
/util/cbfstool/cbfs-mkstage.c: 431 in parse_elf_to_xip_stage()
425     	}
426     
427     	ret = 0;
428     
429     out:
430     	rmodule_cleanup(rmodctx);
>>>     CID 1522880:  Resource leaks  (RESOURCE_LEAK)
>>>     Variable "toload" going out of scope leaks the storage it points to.
431     	return ret;

** CID 1522879:  Error handling issues  (CHECKED_RETURN)
/src/mainboard/google/brya/bootblock.c: 16 in bootblock_mainboard_early_init()


________________________________________________________________________________________________________
*** CID 1522879:  Error handling issues  (CHECKED_RETURN)
/src/mainboard/google/brya/bootblock.c: 16 in bootblock_mainboard_early_init()
10     	size_t num;
11     	pads = variant_early_gpio_table(&num);
12     	gpio_configure_pads(pads, num);
13     
14     	/* Init TPM in non-vboot case so ready in early ramstage before i2c init */
15     	if (!CONFIG(VBOOT))
>>>     CID 1522879:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "tlcl_lib_init" without checking return value (as is done elsewhere 11 out of 12 times).
16     		tlcl_lib_init();
17     }
18     
19     void bootblock_mainboard_init(void)
20     {
21     	variant_update_descriptor();
22     }
23     

** CID 1522878:  Control flow issues  (DEADCODE)
/src/security/vboot/vboot_logic.c: 280 in verstage_main()


________________________________________________________________________________________________________
*** CID 1522878:  Control flow issues  (DEADCODE)
/src/security/vboot/vboot_logic.c: 280 in verstage_main()
274     	timestamp_add_now(TS_TPMINIT_START);
275     	rv = vboot_setup_tpm(ctx);
276     	if (rv == TPM_SUCCESS) {
277     		antirollback_read_space_firmware(ctx);
278     		antirollback_read_space_kernel(ctx);
279     	} else {
>>>     CID 1522878:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach this statement: "vb2api_fail(ctx, VB2_RECOVE...".
280     		vb2api_fail(ctx, VB2_RECOVERY_RO_TPM_S_ERROR, rv);
281     		if (CONFIG(TPM_SETUP_HIBERNATE_ON_ERR) &&
282     				rv == TPM_CB_COMMUNICATION_ERROR) {
283     			printk(BIOS_ERR, "Failed to communicate with TPM\n"
284     					"Next reboot will hibernate to reset TPM");
285     			/* Command the EC to hibernate on next AP shutdown */


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yq2SfQfrHt3Prsn4qSLrYIrajINpiFX8l0vrlNSf8iCrTjqFj-2FaFAQ8isdZKd1XG3Q-3DalRt_L-2FDzr14mnrsJO5b1wX1hp9b1MAQygl7x-2B74RAaH2cn2pRVHGL2hcRbDa2hOXpcfUc-2FSzVnVqfPOAkbQNJSXeL82hSF-2F9kuBTH9I0gvwIUmYaDfta4AmlK4Je2LYpZyxsHoyok-2BofAFjMPDCNNoBcLJLjbQXuvrQmjFzsrD14asQmWpkUzffX2J5mgB49BuMXdSA98vxFMg-2BsZ34GjrCOSA-3D-3D

_______________________________________________
coreboot mailing list -- [email protected]
To unsubscribe send an email to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.