mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
crypto: ccp - Validate that platform access mailbox registers are declared
Some platforms might support platform access doorbell but not mailbox. Add an extra guard to ensure this doesn't cause accesses to wrong ranges if a consumer calls psp_send_platform_access_msg(). Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
66dd59b7aa
commit
dd536cb9f7
1 changed files with 5 additions and 0 deletions
|
@ -67,6 +67,11 @@ int psp_send_platform_access_msg(enum psp_platform_access_msg msg,
|
|||
return -ENODEV;
|
||||
|
||||
pa_dev = psp->platform_access_data;
|
||||
|
||||
if (!pa_dev->vdata->cmdresp_reg || !pa_dev->vdata->cmdbuff_addr_lo_reg ||
|
||||
!pa_dev->vdata->cmdbuff_addr_hi_reg)
|
||||
return -ENODEV;
|
||||
|
||||
cmd = psp->io_regs + pa_dev->vdata->cmdresp_reg;
|
||||
lo = psp->io_regs + pa_dev->vdata->cmdbuff_addr_lo_reg;
|
||||
hi = psp->io_regs + pa_dev->vdata->cmdbuff_addr_hi_reg;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue