Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Srikar Dronamraju and committed by
Michael Ellerman
e7214ae9 a05f0e5b

+2 -1
+2 -1
arch/powerpc/platforms/pseries/vphn.c
··· 82 82 long retbuf[PLPAR_HCALL9_BUFSIZE] = {0}; 83 83 84 84 rc = plpar_hcall9(H_HOME_NODE_ASSOCIATIVITY, retbuf, flags, cpu); 85 - vphn_unpack_associativity(retbuf, associativity); 85 + if (rc == H_SUCCESS) 86 + vphn_unpack_associativity(retbuf, associativity); 86 87 87 88 return rc; 88 89 }