power: wl_blocker: use scnprintf PAGE_SIZE

Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: engstk <eng.stk@sapo.pt>
This commit is contained in:
Denis Efremov
2020-06-13 11:09:19 +03:00
committed by Hannes Ylä-Jääski
parent ff13902830
commit d9ab9a94b0

View File

@ -76,7 +76,7 @@ static ssize_t wakelock_blocker_show(struct device *dev, struct device_attribute
char *buf)
{
// return list of wakelocks to be blocked
return sprintf(buf, "%s\n", list_wl);
return scnprintf(buf, PAGE_SIZE, "%s\n", list_wl);
}
@ -103,7 +103,7 @@ static ssize_t wakelock_blocker_default_show(struct device *dev, struct device_a
char *buf)
{
// return list of wakelocks to be blocked
return sprintf(buf, "%s\n", list_wl_default);
return scnprintf(buf, PAGE_SIZE, "%s\n", list_wl_default);
}
@ -129,8 +129,11 @@ static ssize_t wakelock_blocker_default_store(struct device * dev, struct device
static ssize_t debug_show(struct device *dev, struct device_attribute *attr, char *buf)
{
// return current debug status
return sprintf(buf, "Debug status: %d\n\nUser list: %s\nDefault list: %s\nSearch list: %s\nActive: %d\n",
wl_blocker_debug, list_wl, list_wl_default, list_wl_search, wl_blocker_active);
return scnprintf(buf, PAGE_SIZE,
"Debug status: %d\n\nUser list: %s\nDefault list: %s\n"
"Search list: %s\nActive: %d\n",
wl_blocker_debug, list_wl, list_wl_default,
list_wl_search, wl_blocker_active);
}
@ -159,7 +162,7 @@ static ssize_t debug_store(struct device *dev, struct device_attribute *attr,
static ssize_t version_show(struct device *dev, struct device_attribute *attr, char *buf)
{
// return version information
return sprintf(buf, "%s\n", BOEFFLA_WL_BLOCKER_VERSION);
return scnprintf(buf, PAGE_SIZE, "%s\n", BOEFFLA_WL_BLOCKER_VERSION);
}