diff options
author | Russell Currey <ruscur@russell.cc> | 2016-09-05 16:20:53 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-09-05 16:38:47 +1000 |
commit | 731d1a8d680bd0bf649cf0c4668a449e299e5f55 (patch) | |
tree | 794be4cdcb2c8f40b286662875af63c4c32fcb14 /hw | |
parent | 19ed47363f85634bda960ebe4511829d0d5ecced (diff) | |
download | skiboot-731d1a8d680bd0bf649cf0c4668a449e299e5f55.zip skiboot-731d1a8d680bd0bf649cf0c4668a449e299e5f55.tar.gz skiboot-731d1a8d680bd0bf649cf0c4668a449e299e5f55.tar.bz2 |
nvlink: Fix bad PE number check
NPUs have 4 PEs which are zero indexed, so {0, 1, 2, 3}. A bad PE number
check in npu_err_inject checks if the PE number is greater than 4 as a
fail case, so it would wrongly perform operations on a non-existant PE 4.
Reported-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Cc: stable
Signed-off-by: Russell Currey <ruscur@russell.cc>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/npu.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -929,7 +929,7 @@ static int64_t npu_err_inject(struct phb *phb, uint64_t pe_number, struct npu_dev *dev = NULL; int i; - if (pe_number > NPU_NUM_OF_PES) { + if (pe_number >= NPU_NUM_OF_PES) { prlog(PR_ERR, "NPU: error injection failed, bad PE given\n"); return OPAL_PARAMETER; } |