drivers: qcom: fix userspace write bootmaker issue

The write interface return value does not meet linux standard
so it does not work well when user try to echo new marker.

Change-Id: I5d2d9b0f374f0ffa8d9a500b453828d42e2d0a63
Signed-off-by: Lei wang <leiwan@codeaurora.org>
This commit is contained in:
Lei wang 2021-04-16 13:10:40 +08:00 • committed by Gerrit - the friendly Code Review server
commit b48d31df33

View file

@ -189,7 +189,7 @@ static ssize_t bootkpi_writer(struct kobject *obj, struct kobj_attribute *attr,
if (count >= MAX_STRING_LEN)
return -EINVAL;
rc = scnprintf(buf, count, "%s", user_buffer);
rc = scnprintf(buf, sizeof(buf) - 1, "%s", user_buffer);
if (rc < 0)
return rc;