summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2020-11-27 17:57:13 +0100
committerArnd Bergmann <arnd@arndb.de>2020-11-27 17:57:13 +0100
commit85ccf83e5c5b032dad0d3b162f3408a7fc32c0e7 (patch)
tree27529fe2415dfa0b2b28f466569c1ceb1c63528e
parent3afd2823c1195b77047cad33b208f5b5032f53b3 (diff)
parent9294996f0be40e9da818ed891c82397ab63c00d0 (diff)
Merge tag 'tegra-for-5.11-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers
firmware: tegra: Changes for v5.11-rc1 Contains a single fix for a strncpy()/strncat() issue that some versions of GCC are reporting. * tag 'tegra-for-5.11-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: firmware: tegra: fix strncpy()/strncat() confusion Link: https://lore.kernel.org/r/20201127144329.124891-3-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r--drivers/firmware/tegra/bpmp-debugfs.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/firmware/tegra/bpmp-debugfs.c b/drivers/firmware/tegra/bpmp-debugfs.c
index c1bbba9ee93a..440d99c63638 100644
--- a/drivers/firmware/tegra/bpmp-debugfs.c
+++ b/drivers/firmware/tegra/bpmp-debugfs.c
@@ -412,16 +412,12 @@ static int bpmp_populate_debugfs_inband(struct tegra_bpmp *bpmp,
goto out;
}
- len = strlen(ppath) + strlen(name) + 1;
+ len = snprintf(pathbuf, pathlen, "%s%s/", ppath, name);
if (len >= pathlen) {
err = -EINVAL;
goto out;
}
- strncpy(pathbuf, ppath, pathlen);
- strncat(pathbuf, name, strlen(name));
- strcat(pathbuf, "/");
-
err = bpmp_populate_debugfs_inband(bpmp, dentry,
pathbuf);
if (err < 0)