summaryrefslogtreecommitdiffstats
path: root/hw/npu.c
diff options
context:
space:
mode:
authorRussell Currey <ruscur@russell.cc>2016-09-05 16:20:53 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-09-05 16:38:47 +1000
commit731d1a8d680bd0bf649cf0c4668a449e299e5f55 (patch)
tree794be4cdcb2c8f40b286662875af63c4c32fcb14 /hw/npu.c
parent19ed47363f85634bda960ebe4511829d0d5ecced (diff)
downloadblackbird-skiboot-731d1a8d680bd0bf649cf0c4668a449e299e5f55.tar.gz
blackbird-skiboot-731d1a8d680bd0bf649cf0c4668a449e299e5f55.zip
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/npu.c')
-rw-r--r--hw/npu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/npu.c b/hw/npu.c
index 54f9085c..0682118c 100644
--- a/hw/npu.c
+++ b/hw/npu.c
@@ -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;
}
OpenPOWER on IntegriCloud