summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/huawei-wmi.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2019-10-14 13:58:01 +0300
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2019-10-15 10:55:11 +0300
commit2a43c9fc878a1d3985207a74f73a1f5aa1342655 (patch)
treed3318ba3d007003652d4cf5a0fc8f74ca56ed582 /drivers/platform/x86/huawei-wmi.c
parent3c27f179d502940059ca4f9ed85359a02eaf71e7 (diff)
downloadlinux-2a43c9fc878a1d3985207a74f73a1f5aa1342655.tar.xz
platform/x86: huawei-wmi: Fix a precision vs width printf bug
This was supposed to be precision "%.*s" instead of width "%*s". It's possible that this results in printing beyond the end of the string. Fixes: a970b95345ab ("platform/x86: huawei-wmi: Add debugfs support") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86/huawei-wmi.c')
-rw-r--r--drivers/platform/x86/huawei-wmi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c
index 5bb6fbc9502b..5837d1b8693d 100644
--- a/drivers/platform/x86/huawei-wmi.c
+++ b/drivers/platform/x86/huawei-wmi.c
@@ -616,7 +616,7 @@ static void huawei_wmi_debugfs_call_dump(struct seq_file *m, void *data,
seq_printf(m, "0x%llx", obj->integer.value);
break;
case ACPI_TYPE_STRING:
- seq_printf(m, "\"%*s\"", obj->string.length, obj->string.pointer);
+ seq_printf(m, "\"%.*s\"", obj->string.length, obj->string.pointer);
break;
case ACPI_TYPE_BUFFER:
seq_puts(m, "{");