[Skiboot] [RFC Coverity PATCH 1/2] hw/p7ioc-phb.c: Fix assignment of addr

Stewart Smith stewart at linux.vnet.ibm.com
Thu Aug 13 17:00:49 AEST 2015


Hi Gavin,

are you able to ack this as correct? It does seem to change some logic
as to what's going on, and I'd prefer not to merge things that break PHB
things :)

Kamalesh Babulal <kamalesh at linux.vnet.ibm.com> writes:
> In p7ioc_err_inject_io32() addr is passed as an argument.
> Based on its value , we have a conditional check(s).
> Re-assigning the addr to 0x0ull, make the whole branching
> check(s) a dead code.
>
> Remove the re-assignment of addr, to fix the issue.
>
> Fixes Coverity defect#101020.
>
> Signed-off-by: Kamalesh Babulal <kamalesh at linux.vnet.ibm.com>
> Cc: Gavin Shan <gwshan at linux.vnet.ibm.com>
> ---
>  hw/p7ioc-phb.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/hw/p7ioc-phb.c b/hw/p7ioc-phb.c
> index 0b37993..5167832 100644
> --- a/hw/p7ioc-phb.c
> +++ b/hw/p7ioc-phb.c
> @@ -1409,7 +1409,6 @@ static int64_t p7ioc_err_inject_io32(struct p7ioc_phb *p, uint32_t pe_no,
>  	int32_t index;
>  
>  	a = 0x0ull;
> -	addr = 0x0ull;
>  	prefer = 0x0ull;
>  	for (index = 0; index < 128; index++) {
>  		if (GETFIELD(IODA_XXDT_PE, p->iod_cache[index]) != pe_no)
> -- 
> 2.1.2
>
> _______________________________________________
> Skiboot mailing list
> Skiboot at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/skiboot



More information about the Skiboot mailing list