diff mbox series

[RFC,10/15] powerpc/eeh: Sync eeh_phb_check_failure()

Message ID 572e1a6efbff56513a91d03ddeed53a378781569.1569996166.git.sbobroff@linux.ibm.com (mailing list archive)
State RFC
Headers show
Series powerpc/eeh: Synchronize access to struct eeh_pe | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch warning Failed to apply on branch next (6edfc6487b474fe01857dc3f1a9cd701bb9b21c8)
snowpatch_ozlabs/apply_patch fail Failed to apply to any branch

Commit Message

Sam Bobroff Oct. 2, 2019, 6:02 a.m. UTC
Synchronize access to eeh_pe.

Signed-off-by: Sam Bobroff <sbobroff@linux.ibm.com>
---
 arch/powerpc/kernel/eeh.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index 7eb6ca1ab72b..eb37cb384ff4 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -394,7 +394,7 @@  static int eeh_phb_check_failure(struct eeh_pe *pe)
 		return -EPERM;
 
 	/* Find the PHB PE */
-	phb_pe = eeh_phb_pe_get(pe->phb);
+	phb_pe = eeh_phb_pe_get(pe->phb); /* Acquire ref */
 	if (!phb_pe) {
 		pr_warn("%s Can't find PE for PHB#%x\n",
 			__func__, pe->phb->global_number);
@@ -422,9 +422,10 @@  static int eeh_phb_check_failure(struct eeh_pe *pe)
 
 	pr_debug("EEH: PHB#%x failure detected, location: %s\n",
 		phb_pe->phb->global_number, eeh_pe_loc_get(phb_pe));
-	eeh_send_failure_event(phb_pe);
+	eeh_send_failure_event(phb_pe); /* Give ref */
 	return 1;
 out:
+	eeh_put_pe(phb_pe); /* Release ref */
 	eeh_serialize_unlock(flags);
 	return ret;
 }