mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
mailbox: zynqmp-ipi: Remove dev.parent check in zynqmp_ipi_free_mboxes
[ Upstream commit 019e3f4550fc7d319a7fd03eff487255f8e8aecd ]
The ipi_mbox->dev.parent check is unreliable proxy for registration
status as it fails to protect against probe failures that occur after
the parent is assigned but before device_register() completes.
device_is_registered() is the canonical and robust method to verify the
registration status.
Remove ipi_mbox->dev.parent check in zynqmp_ipi_free_mboxes().
Fixes: 4981b82ba2 ("mailbox: ZynqMP IPI mailbox controller")
Signed-off-by: Harini T <harini.t@amd.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c6cdac3cb3
commit
d3f97bef53
@@ -616,10 +616,8 @@ static void zynqmp_ipi_free_mboxes(struct zynqmp_ipi_pdata *pdata)
|
||||
i = pdata->num_mboxes;
|
||||
for (; i >= 0; i--) {
|
||||
ipi_mbox = &pdata->ipi_mboxes[i];
|
||||
if (ipi_mbox->dev.parent) {
|
||||
if (device_is_registered(&ipi_mbox->dev))
|
||||
device_unregister(&ipi_mbox->dev);
|
||||
}
|
||||
if (device_is_registered(&ipi_mbox->dev))
|
||||
device_unregister(&ipi_mbox->dev);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user