1 From 1cbd7a64959d33e7a2a1fa2bf36a62b350a9fcbd Mon Sep 17 00:00:00 2001
2 From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
3 Date: Wed, 24 Apr 2019 13:09:34 -0500
4 Subject: platform/x86: sony-laptop: Fix unintentional fall-through
6 From: Gustavo A. R. Silva <gustavo@embeddedor.com>
8 commit 1cbd7a64959d33e7a2a1fa2bf36a62b350a9fcbd upstream.
10 It seems that the default case should return AE_CTRL_TERMINATE, instead
11 of falling through to case ACPI_RESOURCE_TYPE_END_TAG and returning AE_OK;
12 otherwise the line of code at the end of the function is unreachable and
15 return AE_CTRL_TERMINATE;
17 This fix is based on the following thread of discussion:
19 https://lore.kernel.org/patchwork/patch/959782/
21 Fixes: 33a04454527e ("sony-laptop: Add SNY6001 device handling (sonypi reimplementation)")
22 Cc: stable@vger.kernel.org
23 Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
24 Reviewed-by: Kees Cook <keescook@chromium.org>
25 Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
26 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29 drivers/platform/x86/sony-laptop.c | 8 +++++---
30 1 file changed, 5 insertions(+), 3 deletions(-)
32 --- a/drivers/platform/x86/sony-laptop.c
33 +++ b/drivers/platform/x86/sony-laptop.c
34 @@ -4394,14 +4394,16 @@ sony_pic_read_possible_resource(struct a
39 + case ACPI_RESOURCE_TYPE_END_TAG:
43 dprintk("Resource %d isn't an IRQ nor an IO port\n",
45 + return AE_CTRL_TERMINATE;
47 - case ACPI_RESOURCE_TYPE_END_TAG:
50 - return AE_CTRL_TERMINATE;
53 static int sony_pic_possible_resources(struct acpi_device *device)