summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtul Raut <araut@codeaurora.org>2016-05-06 12:41:32 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-04-21 05:56:22 -0700
commitd47f05bddec66a466ca29eafffa349a13fe6f50d (patch)
tree540b283f17fb2ddc050327b6bccc62c1c37304d5
parent13b76dbaebba4530e7738003f269dd8b19d9af86 (diff)
soc: qcom: boot_marker: pass formatted buffer to marker
fix scramble boot marker string and pass it to place_marker. CRs-Fixed: 1012714 Change-Id: I0013975aa75cdc15fc66ff320a0a4f3d314c6795 Signed-off-by: Atul Raut <araut@codeaurora.org>
-rw-r--r--drivers/soc/qcom/boot_marker.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/soc/qcom/boot_marker.c b/drivers/soc/qcom/boot_marker.c
index 35c6c9b80905..47ebd2a8b958 100644
--- a/drivers/soc/qcom/boot_marker.c
+++ b/drivers/soc/qcom/boot_marker.c
@@ -27,8 +27,8 @@
#include <linux/mutex.h>
#include <soc/qcom/boot_stats.h>
-#define MAX_STRING_LEN 100
-#define BOOT_MARKER_MAX_LEN 20
+#define MAX_STRING_LEN 256
+#define BOOT_MARKER_MAX_LEN 21
static struct dentry *dent_bkpi, *dent_bkpi_status;
static struct boot_marker boot_marker_list;
@@ -110,13 +110,18 @@ static ssize_t bootkpi_reader(struct file *fp, char __user *user_buffer,
static ssize_t bootkpi_writer(struct file *fp, const char __user *user_buffer,
size_t count, loff_t *position)
{
+ int rc = 0;
char buf[MAX_STRING_LEN];
if (count > MAX_STRING_LEN)
return -EINVAL;
- place_marker((char *) user_buffer);
- return simple_write_to_buffer(buf,
- MAX_STRING_LEN, position, user_buffer, count);
+ rc = simple_write_to_buffer(buf,
+ sizeof(buf) - 1, position, user_buffer, count);
+ if (rc < 0)
+ return rc;
+ buf[rc] = '\0';
+ place_marker(buf);
+ return rc;
}
static int bootkpi_open(struct inode *inode, struct file *file)