[Skiboot] [PATCH] [paca] Fix NULL pointer dereference
    Vasant Hegde 
    hegdevasant at linux.vnet.ibm.com
       
    Thu Jun 18 15:46:27 AEST 2015
    
    
  
On 06/16/2015 04:36 PM, Ananth N Mavinakayanahalli wrote:
> Fix NULL pointer dereference in paca.c
> 
> Signed-off-by: Ananth N Mavinakayanahalli <ananth at in.ibm.com>
> ---
>  hdata/paca.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/hdata/paca.c b/hdata/paca.c
> index d4360e7..d188819 100644
> --- a/hdata/paca.c
> +++ b/hdata/paca.c
> @@ -158,6 +158,9 @@ static void add_icps(void)
>  			const struct sppaca_cpu_id *id;
>  			id = HDIF_get_idata(paca, SPPACA_IDATA_CPU_ID, &size);
>  
> +			if (id == NULL)
> +				continue;
Ananth,
It works .. But I think its better to use CHECK_SPPTR macro. (of course there
are several places where we just checking for NULL).
Also I see similar issues in one or two other places like hdata/memory.c
-Vasant
    
    
More information about the Skiboot
mailing list