diff mbox series

[SRU,Xenial] UBUNTU: SAUCE: powerpc/fadump: fix wrong function return in the backport

Message ID 20181002132512.31330-1-kleber.souza@canonical.com
State New
Headers show
Series [SRU,Xenial] UBUNTU: SAUCE: powerpc/fadump: fix wrong function return in the backport | expand

Commit Message

Kleber Sacilotto de Souza Oct. 2, 2018, 1:25 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1792419

The 4.4.y stable backport c9fadf27006b for upstream commit 1bd6a1c4b80a
("powerpc/fadump: handle crash memory ranges array index overflow")
introduces a build failure on ppc by returning a int in a void function.
In 4.4.y register_fadump() returns void because 98b8cd7f7564
("powerpc/fadump: Return error when fadump registration fails") hasn't
been backported for this stable release.

Fixes: c9fadf27006b ("powerpc/fadump: handle crash memory ranges array index overflow")
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
---
 arch/powerpc/kernel/fadump.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Kleber Sacilotto de Souza Oct. 2, 2018, 1:59 p.m. UTC | #1
On 10/02/18 15:25, Kleber Sacilotto de Souza wrote:
> BugLink: https://bugs.launchpad.net/bugs/1792419
> 
> The 4.4.y stable backport c9fadf27006b for upstream commit 1bd6a1c4b80a
> ("powerpc/fadump: handle crash memory ranges array index overflow")
> introduces a build failure on ppc by returning a int in a void function.
> In 4.4.y register_fadump() returns void because 98b8cd7f7564
> ("powerpc/fadump: Return error when fadump registration fails") hasn't
> been backported for this stable release.
> 
> Fixes: c9fadf27006b ("powerpc/fadump: handle crash memory ranges array index overflow")
> Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
> ---
>  arch/powerpc/kernel/fadump.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
> index 4e71df4048a9..69c8090e5399 100644
> --- a/arch/powerpc/kernel/fadump.c
> +++ b/arch/powerpc/kernel/fadump.c
> @@ -1001,7 +1001,6 @@ static void register_fadump(void)
>  {
>  	unsigned long addr;
>  	void *vaddr;
> -	int ret;
>  
>  	/*
>  	 * If no memory is reserved then we can not register for firmware-
> @@ -1010,9 +1009,8 @@ static void register_fadump(void)
>  	if (!fw_dump.reserve_dump_area_size)
>  		return;
>  
> -	ret = fadump_setup_crash_memory_ranges();
> -	if (ret)
> -		return ret;
> +	if (fadump_setup_crash_memory_ranges())
> +		return;
>  
>  	addr = be64_to_cpu(fdm.rmr_region.destination_address) + be64_to_cpu(fdm.rmr_region.source_len);
>  	/* Initialize fadump crash info header. */
> 

As discussed offline, the best approach would be to backport
"powerpc/fadump: Return error when fadump registration fails" to fix
this build error. I'll send another patch shortly.

Thanks,
Kleber
diff mbox series

Patch

diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 4e71df4048a9..69c8090e5399 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -1001,7 +1001,6 @@  static void register_fadump(void)
 {
 	unsigned long addr;
 	void *vaddr;
-	int ret;
 
 	/*
 	 * If no memory is reserved then we can not register for firmware-
@@ -1010,9 +1009,8 @@  static void register_fadump(void)
 	if (!fw_dump.reserve_dump_area_size)
 		return;
 
-	ret = fadump_setup_crash_memory_ranges();
-	if (ret)
-		return ret;
+	if (fadump_setup_crash_memory_ranges())
+		return;
 
 	addr = be64_to_cpu(fdm.rmr_region.destination_address) + be64_to_cpu(fdm.rmr_region.source_len);
 	/* Initialize fadump crash info header. */