summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrikar Dronamraju <srikar@linux.vnet.ibm.com>2020-01-29 19:22:57 +0530
committerMichael Ellerman <mpe@ellerman.id.au>2020-03-04 22:44:30 +1100
commite7214ae9d85aa325c9f3cb34bf4fad7f112861d7 (patch)
treea7452c3af7aedf721456c38d9743b306c1cc43c9
parenta05f0e5be4e81e4977d3f92aaf7688ee0cb7d5db (diff)
downloadlinux-e7214ae9d85aa325c9f3cb34bf4fad7f112861d7.tar.gz
linux-e7214ae9d85aa325c9f3cb34bf4fad7f112861d7.tar.bz2
linux-e7214ae9d85aa325c9f3cb34bf4fad7f112861d7.zip
powerpc/vphn: Check for error from hcall_vphn
There is no value in unpacking associativity, if H_HOME_NODE_ASSOCIATIVITY hcall has returned an error. Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Reported-by: Abdul Haleem <abdhalee@linux.vnet.ibm.com> Reviewed-by: Nathan Lynch <nathanl@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20200129135301.24739-2-srikar@linux.vnet.ibm.com
-rw-r--r--arch/powerpc/platforms/pseries/vphn.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/pseries/vphn.c b/arch/powerpc/platforms/pseries/vphn.c
index 3f07bf6c670e..cca474a2c396 100644
--- a/arch/powerpc/platforms/pseries/vphn.c
+++ b/arch/powerpc/platforms/pseries/vphn.c
@@ -82,7 +82,8 @@ long hcall_vphn(unsigned long cpu, u64 flags, __be32 *associativity)
long retbuf[PLPAR_HCALL9_BUFSIZE] = {0};
rc = plpar_hcall9(H_HOME_NODE_ASSOCIATIVITY, retbuf, flags, cpu);
- vphn_unpack_associativity(retbuf, associativity);
+ if (rc == H_SUCCESS)
+ vphn_unpack_associativity(retbuf, associativity);
return rc;
}