diff options
Diffstat (limited to 'arch/s390/appldata/appldata_base.c')
-rw-r--r-- | arch/s390/appldata/appldata_base.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c index bae0f402bf2a..87a22092b68f 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c | |||
@@ -212,7 +212,9 @@ appldata_timer_handler(ctl_table *ctl, int write, | |||
212 | return 0; | 212 | return 0; |
213 | } | 213 | } |
214 | if (!write) { | 214 | if (!write) { |
215 | len = sprintf(buf, appldata_timer_active ? "1\n" : "0\n"); | 215 | strncpy(buf, appldata_timer_active ? "1\n" : "0\n", |
216 | ARRAY_SIZE(buf)); | ||
217 | len = strnlen(buf, ARRAY_SIZE(buf)); | ||
216 | if (len > *lenp) | 218 | if (len > *lenp) |
217 | len = *lenp; | 219 | len = *lenp; |
218 | if (copy_to_user(buffer, buf, len)) | 220 | if (copy_to_user(buffer, buf, len)) |
@@ -317,7 +319,8 @@ appldata_generic_handler(ctl_table *ctl, int write, | |||
317 | return 0; | 319 | return 0; |
318 | } | 320 | } |
319 | if (!write) { | 321 | if (!write) { |
320 | len = sprintf(buf, ops->active ? "1\n" : "0\n"); | 322 | strncpy(buf, ops->active ? "1\n" : "0\n", ARRAY_SIZE(buf)); |
323 | len = strnlen(buf, ARRAY_SIZE(buf)); | ||
321 | if (len > *lenp) | 324 | if (len > *lenp) |
322 | len = *lenp; | 325 | len = *lenp; |
323 | if (copy_to_user(buffer, buf, len)) { | 326 | if (copy_to_user(buffer, buf, len)) { |