[flashrom] [PATCH] CID1130002: Logically dead code

Stefan Tauner stefan.tauner at alumni.tuwien.ac.at
Sat Apr 26 20:27:46 CEST 2014


On Tue, 19 Nov 2013 20:35:57 +0100
Stefan Reinauer <stefan.reinauer at coreboot.org> wrote:

> CID1130002: Logically dead code
> 
> The indicated dead code may have performed some action; that action will never
> occur.
> In satamv_init: Code can never be reached because of a logical contradiction
> 
> What we really want to do is check whether PCI_BASE_ADDRESS_2 is valid at this
> point, and not PCI_BASE_ADDRESS_0.
> 
> Signed-off-by: Stefan Reinauer <stefan.reinauer at coreboot.org>
> 
> Index: satamv.c
> ===================================================================
> --- satamv.c	(revision 1763)
> +++ satamv.c	(working copy)
> @@ -139,7 +139,7 @@
>  
>  	/* Get I/O BAR location. */
>  	tmp = pcidev_readbar(dev, PCI_BASE_ADDRESS_2);
> -	if (!addr)
> +	if (!tmp)
>  		return 1;
>  
>  	/* Truncate to reachable range.

Thanks for the patch (and for the whole coverity setup).
The fix was not quite perfect. The data type of addr suits the use much
better than tmp, therefore I have refined the patch a bit to actually
use addr. See r1776.

-- 
Kind regards/Mit freundlichen Grüßen, Stefan Tauner




More information about the flashrom mailing list