Skip to contentSkip to conversation

acpi/apei: Fix in-correct return value

PATCH In review Punit Agrawal 4 participants 6 messages Oct 18, 2016 – Oct 23, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acpi/apei: Fix in-correct return value

Although ghes_proc tests for error while reading the error status, it always return success (0). Fix this by propagating the return value.

Fixes d334a49113a4a33 ("ACPI, APEI, Generic Hardware Error Source memory error support")
Cc "Rafael J. Wysocki" <[email protected]>
Cc Len Brown <[email protected]>
---
 drivers/acpi/apei/ghes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/apei/ghes.c +1 -1
index f0a029e..0d099a2 100644
@@ -662,7 +662,7 @@ static int ghes_proc(struct ghes *ghes)
 	ghes_do_proc(ghes, ghes->estatus);
 out:
 	ghes_clear_estatus(ghes);
-	return 0;
+	return rc;
 }
 
 static void ghes_add_timer(struct ghes *ghes)
Signature · 1 line
2.9.3
Tested-by on v1 1/1
#1 lore raw
Quoted 7 lines · Punit Agrawal

Although ghes_proc tests for error while reading the error status, it always return success (0). Fix this by propagating the return value.

Fixes d334a49113a4a33 ("ACPI, APEI, Generic Hardware Error Source memory error support")
Cc "Rafael J. Wysocki" <[email protected]>
Cc Len Brown <[email protected]>

Thanks,
Tyler

Quoted 17 lines
---
  drivers/acpi/apei/ghes.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/apei/ghes.c +1 -1
index f0a029e..0d099a2 100644
@@ -662,7 +662,7 @@ static int ghes_proc(struct ghes *ghes)
  	ghes_do_proc(ghes, ghes->estatus);
  out:
  	ghes_clear_estatus(ghes);
-	return 0;
+	return rc;
  }
 
  static void ghes_add_timer(struct ghes *ghes)
Signature · 3 lines
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.
#2 lore raw
Quoted 9 lines · Tyler
Quoted 7 lines · Punit Agrawal

Although ghes_proc tests for error while reading the error status, it always return success (0). Fix this by propagating the return value.

Fixes d334a49113a4a33 ("ACPI, APEI, Generic Hardware Error Source memory error support")
Cc "Rafael J. Wysocki" <[email protected]>
Cc Len Brown <[email protected]>

Thanks for taking the patch for a spin.

Hopefully Rafael can pick the patch as a fixes for the next rc.

Quoted 19 lines

Thanks,
Tyler

Quoted 16 lines
---
  drivers/acpi/apei/ghes.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/apei/ghes.c +1 -1
index f0a029e..0d099a2 100644
@@ -662,7 +662,7 @@ static int ghes_proc(struct ghes *ghes)
  	ghes_do_proc(ghes, ghes->estatus);
  out:
  	ghes_clear_estatus(ghes);
-	return 0;
+	return rc;
  }
    static void ghes_add_timer(struct ghes *ghes)
#3 lore raw
In reply to Punit Agrawal
Quoted 17 lines · Punit Agrawal

Although ghes_proc tests for error while reading the error status, it always return success (0). Fix this by propagating the return value.

Fixes d334a49113a4a33 ("ACPI, APEI, Generic Hardware Error Source memory error support")
Cc "Rafael J. Wysocki" <[email protected]>
Cc Len Brown <[email protected]>
---
 drivers/acpi/apei/ghes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/apei/ghes.c +0 -0
index f0a029e..0d099a2 100644

drivers/acpi/apei/ghes.c static int ghes_proc(struct ghes *ghes) · line 668

Quoted 8 lines
drivers/acpi/apei/ghes.c +1 -1
@@ -662,7 +662,7 @@ static int ghes_proc(struct ghes *ghes)
 	ghes_do_proc(ghes, ghes->estatus);
 out:
 	ghes_clear_estatus(ghes);
-	return 0;
+	return rc;
 }
 
 static void ghes_add_timer(struct ghes *ghes)

Boris, all fine here?

Thanks,
Rafael

Reviewed-by
#4 lore raw
Quoted 1 line · Rafael J. Wysocki

Boris, all fine here?

Short answer: Yeah, looks ok to me.

Longer answer: I mean, this way ghes_proc() *actually* propagates the return value of ghes_read_estatus() and we don't do any processing if it failed.

Which doesn't really tell me a whole lot about the actual processing, i.e., what ghes_do_proc() did.

But ghes_do_proc() doesn't return anything and ghes_proc()'s retval is used only in contexts where we're asking whether something got processed or not.

And for that, that fix is adequate. So:

Signature · 5 lines
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 
#5 lore raw
Quoted 12 lines · Borislav Petkov
Quoted 1 line · Rafael J. Wysocki

Boris, all fine here?

Short answer: Yeah, looks ok to me.

Longer answer: I mean, this way ghes_proc() *actually* propagates the return value of ghes_read_estatus() and we don't do any processing if it failed.

Which doesn't really tell me a whole lot about the actual processing, i.e., what ghes_do_proc() did.

Quoted 7 lines

But ghes_do_proc() doesn't return anything and ghes_proc()'s retval is used only in contexts where we're asking whether something got processed or not.

And for that, that fix is adequate. So:

Thanks!