Commit 6dc9a23e authored by Sunil Goutham's avatar Sunil Goutham Committed by Jakub Kicinski

octeontx2-af: Fix interrupt name strings

Fixed interrupt name string logic which currently results
in wrong memory location being accessed while dumping
/proc/interrupts.

Fixes: 48260907 ("octeontx2-af: Enable CPT HW interrupts")
Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
Signed-off-by: default avatarSubbaraya Sundeep <sbhatta@marvell.com>
Link: https://lore.kernel.org/r/1641538505-28367-1-git-send-email-sbhatta@marvell.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent dc35616e
...@@ -172,14 +172,13 @@ static int cpt_10k_register_interrupts(struct rvu_block *block, int off) ...@@ -172,14 +172,13 @@ static int cpt_10k_register_interrupts(struct rvu_block *block, int off)
{ {
struct rvu *rvu = block->rvu; struct rvu *rvu = block->rvu;
int blkaddr = block->addr; int blkaddr = block->addr;
char irq_name[16];
int i, ret; int i, ret;
for (i = CPT_10K_AF_INT_VEC_FLT0; i < CPT_10K_AF_INT_VEC_RVU; i++) { for (i = CPT_10K_AF_INT_VEC_FLT0; i < CPT_10K_AF_INT_VEC_RVU; i++) {
snprintf(irq_name, sizeof(irq_name), "CPTAF FLT%d", i); sprintf(&rvu->irq_name[(off + i) * NAME_SIZE], "CPTAF FLT%d", i);
ret = rvu_cpt_do_register_interrupt(block, off + i, ret = rvu_cpt_do_register_interrupt(block, off + i,
rvu_cpt_af_flt_intr_handler, rvu_cpt_af_flt_intr_handler,
irq_name); &rvu->irq_name[(off + i) * NAME_SIZE]);
if (ret) if (ret)
goto err; goto err;
rvu_write64(rvu, blkaddr, CPT_AF_FLTX_INT_ENA_W1S(i), 0x1); rvu_write64(rvu, blkaddr, CPT_AF_FLTX_INT_ENA_W1S(i), 0x1);
......
...@@ -41,7 +41,7 @@ static bool rvu_common_request_irq(struct rvu *rvu, int offset, ...@@ -41,7 +41,7 @@ static bool rvu_common_request_irq(struct rvu *rvu, int offset,
struct rvu_devlink *rvu_dl = rvu->rvu_dl; struct rvu_devlink *rvu_dl = rvu->rvu_dl;
int rc; int rc;
sprintf(&rvu->irq_name[offset * NAME_SIZE], name); sprintf(&rvu->irq_name[offset * NAME_SIZE], "%s", name);
rc = request_irq(pci_irq_vector(rvu->pdev, offset), fn, 0, rc = request_irq(pci_irq_vector(rvu->pdev, offset), fn, 0,
&rvu->irq_name[offset * NAME_SIZE], rvu_dl); &rvu->irq_name[offset * NAME_SIZE], rvu_dl);
if (rc) if (rc)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment