[Skiboot] [PATCH] sensors: dts: Fix uninitialised data in dts result when reading asynchronously

Nicholas Piggin npiggin at gmail.com
Mon Mar 26 16:39:00 AEDT 2018


On Sun, 25 Mar 2018 17:53:17 +1000
Nicholas Piggin <npiggin at gmail.com> wrote:

> dts_async_read_temp() must zero its on-stack dts structure, similarly
> to dts_sensor_read().
> 
> Cc: Shilpasri G Bhat <shilpa.bhat at linux.vnet.ibm.com>
> Cc: Cédric Le Goater <clg at kaod.org>
> Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
> ---
> 
> The used uninitialized warning showed up when I tried to compile
> skiboot with -O2. Too bad -Os and other static checkers didn't
> catch it.
> 
> I excitedly thought this might also be the cause of the FIXME:,
> but it looks like that predates this bug, and came over from the
> P8 implementation. Has it been tested that the trip bits are still
> wrong? Maybe we can remove it for p9 now?
> 
> Thanks,
> Nick
> ---
> 
>  hw/dts.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/hw/dts.c b/hw/dts.c
> index 949791b0..38811fa9 100644
> --- a/hw/dts.c
> +++ b/hw/dts.c
> @@ -228,11 +228,6 @@ static int dts_read_core_temp_p9(uint32_t pir, struct dts *dts)
>  	prlog(PR_TRACE, "DTS: Chip %x Core %x temp:%dC trip:%x\n",
>  	      chip_id, core, dts->temp, dts->trip);
>  
> -	/*
> -	 * FIXME: The trip bits are always set ?! Just discard
> -	 * them for the moment until we understand why.
> -	 */
> -	dts->trip = 0;
>  	return 0;
>  }
>  

Oops, I intended to remove this hunk from the patch before submitting
it. If it is good, it should be a separate patch.

Thanks,
Nick


More information about the Skiboot mailing list