[PATCH] Fix randconfig build error and code bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Aili Yao <yaoaili@xxxxxxxxxxxx>

CONFIG_ACPI_APEI is not sufficient for ghes module global function
replace it with CONFIG_ACPI_APEI_GHES.

When gen_pool_alloc fails in ghes_in_mce_cper_entry_check, we still need
to try other cper table to get it cleaned even we are likely to get another
allocation fail.

Reported-by: kernel test robot <lkp@xxxxxxxxx>
Signed-off-by: Aili Yao <yaoaili@xxxxxxxxxxxx>
---
 arch/x86/kernel/cpu/mce/internal.h | 6 +++++-
 drivers/acpi/apei/ghes.c           | 4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/mce/internal.h b/arch/x86/kernel/cpu/mce/internal.h
index 1c79b32fcaa9..1fdf8ac45372 100644
--- a/arch/x86/kernel/cpu/mce/internal.h
+++ b/arch/x86/kernel/cpu/mce/internal.h
@@ -70,7 +70,6 @@ int apei_write_mce(struct mce *m);
 ssize_t apei_read_mce(struct mce *m, u64 *record_id);
 int apei_check_mce(void);
 int apei_clear_mce(u64 record_id);
-extern int ghes_in_mce_cper_entry_check(void);
 #else
 static inline int apei_write_mce(struct mce *m)
 {
@@ -88,6 +87,11 @@ static inline int apei_clear_mce(u64 record_id)
 {
 	return -EINVAL;
 }
+#endif
+
+#ifdef CONFIG_ACPI_APEI_GHES
+extern int ghes_in_mce_cper_entry_check(void);
+#else
 static inline int ghes_in_mce_cper_entry_check(void)
 {
 	return 0;
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index ba3140d74f75..8baa19c6b625 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -1131,7 +1131,7 @@ int ghes_in_mce_cper_entry_check(void)
 			/* Going to panic, No need to keep the error. */
 			ghes_clear_estatus(ghes, &tmp_header, buf_paddr, fixmap_idx);
 			ret = -ENOMEM;
-			goto done;
+			continue;
 		}
 
 		estatus_node->ghes = ghes;
@@ -1157,7 +1157,7 @@ int ghes_in_mce_cper_entry_check(void)
 		gen_pool_free(ghes_estatus_pool, (unsigned long)estatus_node,
 		      node_len);
 	}
-done:
+
 	rcu_read_unlock();
 	atomic_dec(&ghes_in_nmi);
 	return ret;

base-commit: b11831c841cb8046a9e01300f5d91985c293e045
-- 
2.18.4





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux