Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <guohanjun@huawei.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>

authored by

Hanjun Guo and committed by
Jassi Brar
425ab036 c3917df5

+7 -2
+7 -2
drivers/mailbox/pcc.c
··· 457 457 pr_warn("Error parsing PCC subspaces from PCCT\n"); 458 458 else 459 459 pr_warn("Invalid PCCT: %d PCC subspaces\n", count); 460 - return -EINVAL; 460 + 461 + rc = -EINVAL; 462 + goto err_put_pcct; 461 463 } 462 464 463 465 pcc_mbox_channels = kcalloc(count, sizeof(struct mbox_chan), 464 466 GFP_KERNEL); 465 467 if (!pcc_mbox_channels) { 466 468 pr_err("Could not allocate space for PCC mbox channels\n"); 467 - return -ENOMEM; 469 + rc = -ENOMEM; 470 + goto err_put_pcct; 468 471 } 469 472 470 473 pcc_doorbell_vaddr = kcalloc(count, sizeof(void *), GFP_KERNEL); ··· 538 535 kfree(pcc_doorbell_vaddr); 539 536 err_free_mbox: 540 537 kfree(pcc_mbox_channels); 538 + err_put_pcct: 539 + acpi_put_table(pcct_tbl); 541 540 return rc; 542 541 } 543 542