Commit 20b5d24c authored by Bitan Biswas's avatar Bitan Biswas Committed by Jassi Brar

mailbox: tegra: avoid resume NULL mailboxes

If Tegra HSP device tree does not have 'shared irqs',
mailboxes pointer is NULL. Add non-NULL HSP mailboxes
check in resume callback before tegra_hsp_mailbox_startup()
call and prevent NULL pointer exception.
Signed-off-by: default avatarBitan Biswas <bbiswas@nvidia.com>
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
parent b1a39953
...@@ -782,12 +782,14 @@ static int __maybe_unused tegra_hsp_resume(struct device *dev) ...@@ -782,12 +782,14 @@ static int __maybe_unused tegra_hsp_resume(struct device *dev)
tegra_hsp_doorbell_startup(db->channel.chan); tegra_hsp_doorbell_startup(db->channel.chan);
} }
if (hsp->mailboxes) {
for (i = 0; i < hsp->num_sm; i++) { for (i = 0; i < hsp->num_sm; i++) {
struct tegra_hsp_mailbox *mb = &hsp->mailboxes[i]; struct tegra_hsp_mailbox *mb = &hsp->mailboxes[i];
if (mb->channel.chan->cl) if (mb->channel.chan->cl)
tegra_hsp_mailbox_startup(mb->channel.chan); tegra_hsp_mailbox_startup(mb->channel.chan);
} }
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment