crypto: hisilicon/debugfs - fix the struct pointer incorrectly offset problem
commit cd26cd65476711e2c69e0a049c0eeef4b743f5ac upstream.
Offset based on (id * size) is wrong for sqc and cqc.
(*sqc/*cqc + 1) can already offset sizeof(struct(Xqc)) length.
Fixes: 15f112f9ce ("crypto: hisilicon/debugfs - mask the unnecessary info from the dump")
Cc: <stable@vger.kernel.org>
Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3abfc4130c
commit
71c359f6a4
@@ -192,7 +192,7 @@ static int qm_sqc_dump(struct hisi_qm *qm, char *s, char *name)
|
||||
|
||||
down_read(&qm->qps_lock);
|
||||
if (qm->sqc) {
|
||||
memcpy(&sqc, qm->sqc + qp_id * sizeof(struct qm_sqc), sizeof(struct qm_sqc));
|
||||
memcpy(&sqc, qm->sqc + qp_id, sizeof(struct qm_sqc));
|
||||
sqc.base_h = cpu_to_le32(QM_XQC_ADDR_MASK);
|
||||
sqc.base_l = cpu_to_le32(QM_XQC_ADDR_MASK);
|
||||
dump_show(qm, &sqc, sizeof(struct qm_sqc), "SOFT SQC");
|
||||
@@ -229,7 +229,7 @@ static int qm_cqc_dump(struct hisi_qm *qm, char *s, char *name)
|
||||
|
||||
down_read(&qm->qps_lock);
|
||||
if (qm->cqc) {
|
||||
memcpy(&cqc, qm->cqc + qp_id * sizeof(struct qm_cqc), sizeof(struct qm_cqc));
|
||||
memcpy(&cqc, qm->cqc + qp_id, sizeof(struct qm_cqc));
|
||||
cqc.base_h = cpu_to_le32(QM_XQC_ADDR_MASK);
|
||||
cqc.base_l = cpu_to_le32(QM_XQC_ADDR_MASK);
|
||||
dump_show(qm, &cqc, sizeof(struct qm_cqc), "SOFT CQC");
|
||||
|
||||
Reference in New Issue
Block a user