Thread (2 messages) 2 messages, 2 authors, 2017-01-27

[PATCH v2] powerpc/eeh: Fix wrong flag passed to eeh_unfreeze_pe()

From: Gavin Shan <hidden>
Date: 2017-01-18 23:11:30
Also in: linuxppc-dev
Subsystem: linux for powerpc (32-bit and 64-bit), pci enhanced error handling (eeh) for powerpc, the rest · Maintainers: Madhavan Srinivasan, Michael Ellerman, Mahesh J Salgaonkar, Linus Torvalds

In __eeh_clear_pe_frozen_state(), we should pass the flag's value
instead of its address to eeh_unfreeze_pe(). The isolated flag is
cleared if no error returned from __eeh_clear_pe_frozen_state().
We never observed the error from the function. So the isolated flag
should have been always cleared, no real issue is caused because
of the misused @flag.

This fixes the code by passing the value of @flag to eeh_unfreeze_pe().

Cc: stable@vger.kernel.org #3.18+
Fixes: 5cfb20b96f6 ("powerpc/eeh: Emulate EEH recovery for VFIO devices")
Signed-off-by: Gavin Shan <redacted>
---
v2: Improved changelog and dereference @flag for once
---
 arch/powerpc/kernel/eeh_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
index d88573b..b948871 100644
--- a/arch/powerpc/kernel/eeh_driver.c
+++ b/arch/powerpc/kernel/eeh_driver.c
@@ -545,7 +545,7 @@ static void *eeh_pe_detach_dev(void *data, void *userdata)
 static void *__eeh_clear_pe_frozen_state(void *data, void *flag)
 {
 	struct eeh_pe *pe = (struct eeh_pe *)data;
-	bool *clear_sw_state = flag;
+	bool clear_sw_state = *(bool *)flag;
 	int i, rc = 1;
 
 	for (i = 0; rc && i < 3; i++)
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help