Skip to content

Commit 425ab03

Browse files
guohanjunJassiBrar
authored andcommittedAug 4, 2020
mailbox: pcc: Put the PCCT table for error path
The acpi_get_table() should be coupled with acpi_put_table() if the mapped table is not used at runtime to release the table mapping. In acpi_pcc_probe(), the PCCT table entries will be used as private data for communication chan at runtime, but the table should be put for error path. Signed-off-by: Hanjun Guo <[email protected]> Signed-off-by: Jassi Brar <[email protected]>
1 parent c3917df commit 425ab03

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

‎drivers/mailbox/pcc.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -457,14 +457,17 @@ static int __init acpi_pcc_probe(void)
457457
pr_warn("Error parsing PCC subspaces from PCCT\n");
458458
else
459459
pr_warn("Invalid PCCT: %d PCC subspaces\n", count);
460-
return -EINVAL;
460+
461+
rc = -EINVAL;
462+
goto err_put_pcct;
461463
}
462464

463465
pcc_mbox_channels = kcalloc(count, sizeof(struct mbox_chan),
464466
GFP_KERNEL);
465467
if (!pcc_mbox_channels) {
466468
pr_err("Could not allocate space for PCC mbox channels\n");
467-
return -ENOMEM;
469+
rc = -ENOMEM;
470+
goto err_put_pcct;
468471
}
469472

470473
pcc_doorbell_vaddr = kcalloc(count, sizeof(void *), GFP_KERNEL);
@@ -535,6 +538,8 @@ static int __init acpi_pcc_probe(void)
535538
kfree(pcc_doorbell_vaddr);
536539
err_free_mbox:
537540
kfree(pcc_mbox_channels);
541+
err_put_pcct:
542+
acpi_put_table(pcct_tbl);
538543
return rc;
539544
}
540545

0 commit comments

Comments
 (0)
Please sign in to comment.