firmware: tegra: Add return code checks and increase debugfs size
authorTimo Alho <talho@nvidia.com>
Sun, 12 Jul 2020 10:01:14 +0000 (11:01 +0100)
committerThierry Reding <treding@nvidia.com>
Tue, 14 Jul 2020 15:56:28 +0000 (17:56 +0200)
commit8b08dbb1b14ae1142003cb8a95e71e48b3a416d4
tree94c4576d57991dad8283776982eb217a16369329
parentb3a9e3b9622ae10064826dccb4f7a52bd88c7407
firmware: tegra: Add return code checks and increase debugfs size

Add checking of the BPMP-FW return code values for MRQ_DEBUGFS calls.

Also, development versions of the firmware may have debugfs with a
directory structure larger than 256 KiB. Hence increase the size of the
memory buffer to accommodate those firmware revisions.

And finally, ensure that no access outside of allocated memory buffer
happens in case BPMP-FW returns an invalid response size (nbytes) from
mrq_debugfs_dumpdir() call.

Signed-off-by: Timo Alho <talho@nvidia.com>
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/firmware/tegra/bpmp-debugfs.c