[scan-admin at coverity.com: New Defects reported by Coverity Scan for Das U-Boot]

Tom Rini trini at konsulko.com
Tue Feb 23 17:15:53 CET 2021


----- Forwarded message from scan-admin at coverity.com -----

Date: Mon, 22 Feb 2021 16:03:35 +0000 (UTC)
From: scan-admin at coverity.com
To: tom.rini at gmail.com
Subject: New Defects reported by Coverity Scan for Das U-Boot

Hi,

Please find the latest report on new defect(s) introduced to Das U-Boot found with Coverity Scan.

3 new defect(s) introduced to Das U-Boot found with Coverity Scan.
1 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 3 of 3 defect(s)


** CID 320541:    (UNREACHABLE)
/common/fdt_support.c: 1403 in fdt_get_dma_range()
/common/fdt_support.c: 1394 in fdt_get_dma_range()


________________________________________________________________________________________________________
*** CID 320541:    (UNREACHABLE)
/common/fdt_support.c: 1403 in fdt_get_dma_range()
1397     	bus_node = of_match_bus(blob, parent);
1398     	bus_node->count_cells(blob, parent, &pna, &pns);
1399     	if (!OF_CHECK_COUNTS(pna, pns)) {
1400     		printf("%s: Bad cell count for %s\n", __FUNCTION__,
1401     		       fdt_get_name(blob, parent, NULL));
1402     		return -EINVAL;
>>>     CID 320541:    (UNREACHABLE)
>>>     This code cannot be reached: "goto out;".
1403     		goto out;
1404     	}
1405     
1406     	*bus = fdt_read_number(ranges, na);
1407     	*cpu = fdt_translate_dma_address(blob, node, ranges + na);
1408     	*size = fdt_read_number(ranges + na + pna, ns);
/common/fdt_support.c: 1394 in fdt_get_dma_range()
1388     	bus_node = of_match_bus(blob, node);
1389     	bus_node->count_cells(blob, node, &na, &ns);
1390     	if (!OF_CHECK_COUNTS(na, ns)) {
1391     		printf("%s: Bad cell count for %s\n", __FUNCTION__,
1392     		       fdt_get_name(blob, node, NULL));
1393     		return -EINVAL;
>>>     CID 320541:    (UNREACHABLE)
>>>     This code cannot be reached: "goto out;".
1394     		goto out;
1395     	}
1396     
1397     	bus_node = of_match_bus(blob, parent);
1398     	bus_node->count_cells(blob, parent, &pna, &pns);
1399     	if (!OF_CHECK_COUNTS(pna, pns)) {

** CID 320540:  Null pointer dereferences  (REVERSE_INULL)
/lib/efi_loader/efi_device_path_to_text.c: 372 in efi_convert_device_path_to_text()


________________________________________________________________________________________________________
*** CID 320540:  Null pointer dereferences  (REVERSE_INULL)
/lib/efi_loader/efi_device_path_to_text.c: 372 in efi_convert_device_path_to_text()
366     	char *str = buffer;
367     
368     	EFI_ENTRY("%p, %d, %d", device_path, display_only, allow_shortcuts);
369     
370     	if (!device_path)
371     		goto out;
>>>     CID 320540:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "device_path" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
372     	while (device_path && str + MAX_NODE_LEN < buffer + MAX_PATH_LEN) {
373     		if (device_path->type == DEVICE_PATH_TYPE_END) {
374     			if (device_path->sub_type !=
375     			    DEVICE_PATH_SUB_TYPE_INSTANCE_END)
376     				break;
377     			*str++ = ',';

** CID 320539:    (UNREACHABLE)
/drivers/core/of_addr.c: 376 in of_get_dma_range()
/drivers/core/of_addr.c: 384 in of_get_dma_range()


________________________________________________________________________________________________________
*** CID 320539:    (UNREACHABLE)
/drivers/core/of_addr.c: 376 in of_get_dma_range()
370     	/* Get the address sizes both for the bus and its parent */
371     	bus_node = of_match_bus((struct device_node*)dev);
372     	bus_node->count_cells(dev, &na, &ns);
373     	if (!OF_CHECK_COUNTS(na, ns)) {
374     		printf("Bad cell count for %s\n", of_node_full_name(dev));
375     		return -EINVAL;
>>>     CID 320539:    (UNREACHABLE)
>>>     This code cannot be reached: "goto out_parent;".
376     		goto out_parent;
377     	}
378     
379     	bus_node = of_match_bus(parent);
380     	bus_node->count_cells(parent, &pna, &pns);
381     	if (!OF_CHECK_COUNTS(pna, pns)) {
/drivers/core/of_addr.c: 384 in of_get_dma_range()
378     
379     	bus_node = of_match_bus(parent);
380     	bus_node->count_cells(parent, &pna, &pns);
381     	if (!OF_CHECK_COUNTS(pna, pns)) {
382     		printf("Bad cell count for %s\n", of_node_full_name(parent));
383     		return -EINVAL;
>>>     CID 320539:    (UNREACHABLE)
>>>     This code cannot be reached: "goto out_parent;".
384     		goto out_parent;
385     	}
386     
387     	*bus = of_read_number(ranges, na);
388     	*cpu = of_translate_dma_address(dev, ranges + na);
389     	*size = of_read_number(ranges + na + pna, ns);


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yoA22WlOQ-2By3ieUvdbKmOyw68TMVT4Kip-2BBzfOGWXJ5yIiYplmPF9KAnKIja4Zd7tU-3DkhgB_EEm8SbLgSDsaDZif-2Bv7ch8WqhKpLoKErHi4nXpwDNTuFndYt0428JASMRkmHZLSITBJ0Vi-2FD6f05nIVUSmnVv8EiELa3JyWOENpLUHtuZOod1gP-2Bguh9C-2F8bIopNkrVgNm-2FXOHQf-2FNn4-2BfWygEtp3JHQjNO8fjvcw4h6bT-2FYfq3wAl1yg3N7cqeEXOfLrUD-2BPXwNzuNZHbsXHu9-2F1uV5Rz16-2Fnox4-2B6vKs-2F6a5r39Gc-3D

  To manage Coverity Scan email notifications for "tom.rini at gmail.com", click https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yped04pjJnmXOsUBtKYNIXxWeIHzDeopm-2BEWQ6S6K-2FtUHv9ZTk8qZbuzkkz9sa-2BJFw4elYDyedRVZOC-2ButxjBZdouVmTGuWB6Aj6G7lm7t25-2Biv1B-2B9082pHzCCex2kqMs-3Dv5l0_EEm8SbLgSDsaDZif-2Bv7ch8WqhKpLoKErHi4nXpwDNTuFndYt0428JASMRkmHZLSIiYWEii5TpKwkyhfq4t-2F2ietx17-2F0IqZk8o7XGEEyQFKDgmzmDngfP9-2Bitq0jamteMGX-2B4Qmi6nbdRIW9Hkd6ixfEQD0P5FK8F-2BtWnJTkUb388b59jLc1GgEnlcEKwE15dqxmOSOg0VHdWyeOw9fLK4gMsJhgG-2FM-2B9uxrzZaJtE8-3D


----- End forwarded message -----

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210223/15e48610/attachment.sig>


More information about the U-Boot mailing list