platform/x86: sony-laptop: Fix unintentional fall-through
Subsystems (2)
PATCH 1/1 platform/x86: sony-laptop: Fix unintentional fall-through
It seems that the default case should return AE_CTRL_TERMINATE, instead of falling through to case ACPI_RESOURCE_TYPE_END_TAG and returning AE_OK; otherwise the line of code at the end of the function is unreachable and makes no sense:
return AE_CTRL_TERMINATE;
This fix is based on the following thread of discussion:
https://lore.kernel.org/patchwork/patch/959782/
--- drivers/platform/x86/sony-laptop.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/platform/x86/sony-laptop.c +5 -3
@@ -4424,14 +4424,16 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context) }return AE_OK ; } + +case ACPI_RESOURCE_TYPE_END_TAG : +return AE_OK ; +default :dprintk ("Resource %d isn't an IRQ nor an IO port\n" , resource->type); +return AE_CTRL_TERMINATE ; -case ACPI_RESOURCE_TYPE_END_TAG : -return AE_OK ; } -return AE_CTRL_TERMINATE ; }static int sony_pic_possible_resources (struct acpi_device *device)
Signature · 1 line
2.21.0
Hi all,
Friendly ping:
Who can take this?
Thanks
--
Gustavo
Quoted 43 lines · Gustavo A. R. Silva
It seems that the default case should return
AE_CTRL_TERMINATE, instead of falling through to caseACPI_RESOURCE_TYPE_END_TAGand returningAE_OK; otherwise the line of code at the end of the function is unreachable and makes no sense:return
AE_CTRL_TERMINATE;This fix is based on the following thread of discussion:
https://lore.kernel.org/patchwork/patch/959782/
Fixes 33a04454527e ("sony-laptop: Add SNY6001 device handling (sonypi reimplementation)")Signed-off-by Gustavo A. R. Silva <[email protected]>--- drivers/platform/x86/sony-laptop.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/platform/x86/sony-laptop.c +5
-3@@ -4424,14 +4424,16 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context) }return AE_OK ; } + +case ACPI_RESOURCE_TYPE_END_TAG : +return AE_OK ; +default :dprintk ("Resource %d isn't an IRQ nor an IO port\n" , resource->type); +return AE_CTRL_TERMINATE ; -case ACPI_RESOURCE_TYPE_END_TAG : -return AE_OK ; } -return AE_CTRL_TERMINATE ; }static int sony_pic_possible_resources (struct acpi_device *device)
Quoted 8 lines · Gustavo A. R. Silva
It seems that the default case should return
AE_CTRL_TERMINATE, instead of falling through to caseACPI_RESOURCE_TYPE_END_TAGand returningAE_OK; otherwise the line of code at the end of the function is unreachable and makes no sense:return
AE_CTRL_TERMINATE;
Quoted 7 lines
This fix is based on the following thread of discussion:
https://lore.kernel.org/patchwork/patch/959782/
Fixes 33a04454527e ("sony-laptop: Add SNY6001 device handling (sonypi reimplementation)")Signed-off-by Gustavo A. R. Silva <[email protected]>
-Kees
Quoted 31 lines
--- drivers/platform/x86/sony-laptop.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/platform/x86/sony-laptop.c +5
-4@@ -4424,14 +4424,16 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context) }return AE_OK ; } + +case ACPI_RESOURCE_TYPE_END_TAG : +return AE_OK ; +default :dprintk ("Resource %d isn't an IRQ nor an IO port\n" , resource->type); +return AE_CTRL_TERMINATE ; -case ACPI_RESOURCE_TYPE_END_TAG : -return AE_OK ; } -return AE_CTRL_TERMINATE ; }static int sony_pic_possible_resources (struct acpi_device *device) --2.21.0
Signature · 1 line
Kees Cook
Quoted 6 lines · Gustavo A. R. Silva
Hi all,
Friendly ping:
Who can take this?
Pushed to my review and testing queue, thanks!
Quoted 49 lines
Thanks
--
GustavoQuoted 43 lines · Gustavo A. R. Silva
It seems that the default case should return
AE_CTRL_TERMINATE, instead of falling through to caseACPI_RESOURCE_TYPE_END_TAGand returningAE_OK; otherwise the line of code at the end of the function is unreachable and makes no sense:return
AE_CTRL_TERMINATE;This fix is based on the following thread of discussion:
https://lore.kernel.org/patchwork/patch/959782/
Fixes 33a04454527e ("sony-laptop: Add SNY6001 device handling (sonypi reimplementation)")Signed-off-by Gustavo A. R. Silva <[email protected]>--- drivers/platform/x86/sony-laptop.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/platform/x86/sony-laptop.c +5
-3@@ -4424,14 +4424,16 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context) }return AE_OK ; } + +case ACPI_RESOURCE_TYPE_END_TAG : +return AE_OK ; +default :dprintk ("Resource %d isn't an IRQ nor an IO port\n" , resource->type); +return AE_CTRL_TERMINATE ; -case ACPI_RESOURCE_TYPE_END_TAG : -return AE_OK ; } -return AE_CTRL_TERMINATE ; }static int sony_pic_possible_resources (struct acpi_device *device)
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 11 lines · Andy Shevchenko
Quoted 6 lines · Gustavo A. R. Silva
Hi all,
Friendly ping:
Who can take this?
Pushed to my review and testing queue, thanks!
Awesome. :)
Thanks, Andy.
--
Gustavo
Quoted 53 lines
Quoted 50 lines
Thanks
--
GustavoQuoted 43 lines · Gustavo A. R. Silva
It seems that the default case should return
AE_CTRL_TERMINATE, instead of falling through to caseACPI_RESOURCE_TYPE_END_TAGand returningAE_OK; otherwise the line of code at the end of the function is unreachable and makes no sense:return
AE_CTRL_TERMINATE;This fix is based on the following thread of discussion:
https://lore.kernel.org/patchwork/patch/959782/
Fixes 33a04454527e ("sony-laptop: Add SNY6001 device handling (sonypi reimplementation)")Signed-off-by Gustavo A. R. Silva <[email protected]>--- drivers/platform/x86/sony-laptop.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/platform/x86/sony-laptop.c +5
-3@@ -4424,14 +4424,16 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context) }return AE_OK ; } + +case ACPI_RESOURCE_TYPE_END_TAG : +return AE_OK ; +default :dprintk ("Resource %d isn't an IRQ nor an IO port\n" , resource->type); +return AE_CTRL_TERMINATE ; -case ACPI_RESOURCE_TYPE_END_TAG : -return AE_OK ; } -return AE_CTRL_TERMINATE ; }static int sony_pic_possible_resources (struct acpi_device *device)