aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaghavendra Rao Ananta <[email protected]>2021-03-03 13:47:02 -0800
committerBjorn Andersson <[email protected]>2021-03-08 12:27:21 -0600
commit145e1da374bcba14c9ca069646f68b76c422612a (patch)
treeb2a11ca22ee285adac76539c2e488022a5c30184
parenta38fd8748464831584a19438cbb3082b5a2dab15 (diff)
remoteproc: sysfs: Use sysfs_emit instead of sprintf
For security reasons sysfs_emit() is preferred over sprintf(). Hence, convert the remoteproc's sysfs show functions accordingly. Signed-off-by: Raghavendra Rao Ananta <[email protected]> Signed-off-by: Siddharth Gupta <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Andersson <[email protected]>
-rw-r--r--drivers/remoteproc/remoteproc_sysfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/remoteproc/remoteproc_sysfs.c b/drivers/remoteproc/remoteproc_sysfs.c
index 1dbef895e65e..6840dad931d5 100644
--- a/drivers/remoteproc/remoteproc_sysfs.c
+++ b/drivers/remoteproc/remoteproc_sysfs.c
@@ -15,7 +15,7 @@ static ssize_t recovery_show(struct device *dev,
{
struct rproc *rproc = to_rproc(dev);
- return sprintf(buf, "%s", rproc->recovery_disabled ? "disabled\n" : "enabled\n");
+ return sysfs_emit(buf, "%s", rproc->recovery_disabled ? "disabled\n" : "enabled\n");
}
/*
@@ -82,7 +82,7 @@ static ssize_t coredump_show(struct device *dev,
{
struct rproc *rproc = to_rproc(dev);
- return sprintf(buf, "%s\n", rproc_coredump_str[rproc->dump_conf]);
+ return sysfs_emit(buf, "%s\n", rproc_coredump_str[rproc->dump_conf]);
}
/*