]>
Commit | Line | Data |
---|---|---|
321d628a FG |
1 | From 8edefc098e2ff088d8c22d034bf8a5adf76b7295 Mon Sep 17 00:00:00 2001 |
2 | From: Dongjiu Geng <gengdongjiu@huawei.com> | |
3 | Date: Tue, 17 Oct 2017 16:02:20 +0800 | |
633c5ed1 | 4 | Subject: [PATCH 078/242] ACPI / APEI: remove the unused dead-code for SEA/NMI |
321d628a FG |
5 | notification type |
6 | MIME-Version: 1.0 | |
7 | Content-Type: text/plain; charset=UTF-8 | |
8 | Content-Transfer-Encoding: 8bit | |
9 | ||
10 | CVE-2017-5754 | |
11 | ||
12 | For the SEA notification, the two functions ghes_sea_add() and | |
13 | ghes_sea_remove() are only called when CONFIG_ACPI_APEI_SEA | |
14 | is defined. If not, it will return errors in the ghes_probe() | |
15 | and not continue. If the probe is failed, the ghes_sea_remove() | |
16 | also has no chance to be called. Hence, remove the unnecessary | |
17 | handling when CONFIG_ACPI_APEI_SEA is not defined. | |
18 | ||
19 | For the NMI notification, it has the same issue as SEA notification, | |
20 | so also remove the unused dead-code for it. | |
21 | ||
22 | Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com> | |
23 | Tested-by: Tyler Baicar <tbaicar@codeaurora.org> | |
24 | Reviewed-by: Borislav Petkov <bp@suse.de> | |
25 | Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> | |
26 | (cherry picked from commit c49870e89f4d2c21c76ebe90568246bb0f3572b7) | |
27 | Signed-off-by: Andy Whitcroft <apw@canonical.com> | |
28 | Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com> | |
29 | (cherry picked from commit 55f73c32ba6438e8886f348722d2b25aef129d40) | |
30 | Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> | |
31 | --- | |
32 | drivers/acpi/apei/ghes.c | 33 +++++---------------------------- | |
33 | 1 file changed, 5 insertions(+), 28 deletions(-) | |
34 | ||
35 | diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c | |
36 | index 3628078ee351..4827176f838d 100644 | |
37 | --- a/drivers/acpi/apei/ghes.c | |
38 | +++ b/drivers/acpi/apei/ghes.c | |
39 | @@ -850,17 +850,8 @@ static void ghes_sea_remove(struct ghes *ghes) | |
40 | synchronize_rcu(); | |
41 | } | |
42 | #else /* CONFIG_ACPI_APEI_SEA */ | |
43 | -static inline void ghes_sea_add(struct ghes *ghes) | |
44 | -{ | |
45 | - pr_err(GHES_PFX "ID: %d, trying to add SEA notification which is not supported\n", | |
46 | - ghes->generic->header.source_id); | |
47 | -} | |
48 | - | |
49 | -static inline void ghes_sea_remove(struct ghes *ghes) | |
50 | -{ | |
51 | - pr_err(GHES_PFX "ID: %d, trying to remove SEA notification which is not supported\n", | |
52 | - ghes->generic->header.source_id); | |
53 | -} | |
54 | +static inline void ghes_sea_add(struct ghes *ghes) { } | |
55 | +static inline void ghes_sea_remove(struct ghes *ghes) { } | |
56 | #endif /* CONFIG_ACPI_APEI_SEA */ | |
57 | ||
58 | #ifdef CONFIG_HAVE_ACPI_APEI_NMI | |
59 | @@ -1062,23 +1053,9 @@ static void ghes_nmi_init_cxt(void) | |
60 | init_irq_work(&ghes_proc_irq_work, ghes_proc_in_irq); | |
61 | } | |
62 | #else /* CONFIG_HAVE_ACPI_APEI_NMI */ | |
63 | -static inline void ghes_nmi_add(struct ghes *ghes) | |
64 | -{ | |
65 | - pr_err(GHES_PFX "ID: %d, trying to add NMI notification which is not supported!\n", | |
66 | - ghes->generic->header.source_id); | |
67 | - BUG(); | |
68 | -} | |
69 | - | |
70 | -static inline void ghes_nmi_remove(struct ghes *ghes) | |
71 | -{ | |
72 | - pr_err(GHES_PFX "ID: %d, trying to remove NMI notification which is not supported!\n", | |
73 | - ghes->generic->header.source_id); | |
74 | - BUG(); | |
75 | -} | |
76 | - | |
77 | -static inline void ghes_nmi_init_cxt(void) | |
78 | -{ | |
79 | -} | |
80 | +static inline void ghes_nmi_add(struct ghes *ghes) { } | |
81 | +static inline void ghes_nmi_remove(struct ghes *ghes) { } | |
82 | +static inline void ghes_nmi_init_cxt(void) { } | |
83 | #endif /* CONFIG_HAVE_ACPI_APEI_NMI */ | |
84 | ||
85 | static int ghes_probe(struct platform_device *ghes_dev) | |
86 | -- | |
87 | 2.14.2 | |
88 |