Patchwork [1/8] powerpc/pseries: fix creation of loop in device node property list

login
register
mail settings
Submitter Tyrel Datwyler
Date Aug. 15, 2013, 5:23 a.m.
Message ID <1376544232-24936-2-git-send-email-tyreld@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/267316/
State Accepted, archived
Commit d8e533b45fd98aa72957d9580d97aa0ab45265ad
Headers show

Comments

Tyrel Datwyler - Aug. 15, 2013, 5:23 a.m.
The update_dt_prop helper function fails to set the IN/OUT parameter prop to
NULL after a complete property has been parsed from the work area returned by
the ibm,update-properties rtas function. This results in the property list of
the device node being updated is corrupted and becomes a loop since the same
property structure is used repeatedly.

Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/pseries/mobility.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Nathan Fontenot - Aug. 19, 2013, 1:43 p.m.
On 08/15/2013 12:23 AM, Tyrel Datwyler wrote:
> The update_dt_prop helper function fails to set the IN/OUT parameter prop to
> NULL after a complete property has been parsed from the work area returned by
> the ibm,update-properties rtas function. This results in the property list of
> the device node being updated is corrupted and becomes a loop since the same
> property structure is used repeatedly.
> 
> Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>

Acked-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>

> ---
>  arch/powerpc/platforms/pseries/mobility.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
> index 3d01eee..f28abee 100644
> --- a/arch/powerpc/platforms/pseries/mobility.c
> +++ b/arch/powerpc/platforms/pseries/mobility.c
> @@ -119,7 +119,7 @@ static int update_dt_property(struct device_node *dn, struct property **prop,
>  
>  	if (!more) {
>  		of_update_property(dn, new_prop);
> -		new_prop = NULL;
> +		*prop = NULL;
>  	}
>  
>  	return 0;
>

Patch

diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
index 3d01eee..f28abee 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -119,7 +119,7 @@  static int update_dt_property(struct device_node *dn, struct property **prop,
 
 	if (!more) {
 		of_update_property(dn, new_prop);
-		new_prop = NULL;
+		*prop = NULL;
 	}
 
 	return 0;