mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
mailbox: zynqmp: Fix counts of child nodes
[ Upstream commitf72f805e72
] If child mailbox node status is disabled it causes crash in interrupt handler. Fix this by assigning only available child node during driver probe. Fixes:4981b82ba2
("mailbox: ZynqMP IPI mailbox controller") Signed-off-by: Tanmay Shah <tanmay.shah@amd.com> Acked-by: Michal Simek <michal.simek@amd.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230311012407.1292118-2-tanmay.shah@amd.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
e63a796b85
commit
50f54a48f6
1 changed files with 6 additions and 1 deletions
|
@ -634,7 +634,12 @@ static int zynqmp_ipi_probe(struct platform_device *pdev)
|
||||||
struct zynqmp_ipi_mbox *mbox;
|
struct zynqmp_ipi_mbox *mbox;
|
||||||
int num_mboxes, ret = -EINVAL;
|
int num_mboxes, ret = -EINVAL;
|
||||||
|
|
||||||
num_mboxes = of_get_child_count(np);
|
num_mboxes = of_get_available_child_count(np);
|
||||||
|
if (num_mboxes == 0) {
|
||||||
|
dev_err(dev, "mailbox nodes not available\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
pdata = devm_kzalloc(dev, struct_size(pdata, ipi_mboxes, num_mboxes),
|
pdata = devm_kzalloc(dev, struct_size(pdata, ipi_mboxes, num_mboxes),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!pdata)
|
if (!pdata)
|
||||||
|
|
Loading…
Reference in a new issue