diff options
-rw-r--r-- | drivers/mailbox/pcc.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c index 8c7fac38bb1c..ef9ecd1f5958 100644 --- a/drivers/mailbox/pcc.c +++ b/drivers/mailbox/pcc.c @@ -457,14 +457,17 @@ static int __init acpi_pcc_probe(void) pr_warn("Error parsing PCC subspaces from PCCT\n"); else pr_warn("Invalid PCCT: %d PCC subspaces\n", count); - return -EINVAL; + + rc = -EINVAL; + goto err_put_pcct; } pcc_mbox_channels = kcalloc(count, sizeof(struct mbox_chan), GFP_KERNEL); if (!pcc_mbox_channels) { pr_err("Could not allocate space for PCC mbox channels\n"); - return -ENOMEM; + rc = -ENOMEM; + goto err_put_pcct; } pcc_doorbell_vaddr = kcalloc(count, sizeof(void *), GFP_KERNEL); @@ -535,6 +538,8 @@ err_free_db_vaddr: kfree(pcc_doorbell_vaddr); err_free_mbox: kfree(pcc_mbox_channels); +err_put_pcct: + acpi_put_table(pcct_tbl); return rc; } |