aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeikki Krogerus <[email protected]>2024-12-05 11:39:19 +0000
committerGreg Kroah-Hartman <[email protected]>2024-12-23 17:40:19 +0000
commitded71f07f92f83b7695f974db9951a8b014cbefc (patch)
tree30098d2b97c7147f6008eebf551f3985555d6a36
parentMerge 6.14-rc4 into usb-next (diff)
downloadkernel-ded71f07f92f83b7695f974db9951a8b014cbefc.tar.gz
kernel-ded71f07f92f83b7695f974db9951a8b014cbefc.zip
usb: typec: intel_pmc_mux: Silence snprintf() output truncation warning
In the function pmc_mux_port_debugfs_init() the buffer for the name of the port is limited to six bytes. That makes the compiler think that the output of "port%d" may be truncated. That can't actually happen as the interface can support maximum of eight ports. To make the compiler happy just increase the buffer to where the warning goes away. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Cc: Rajat Khandelwal <[email protected]> Signed-off-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/usb/typec/mux/intel_pmc_mux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c
index 5dfe95754394..65dda9183e6f 100644
--- a/drivers/usb/typec/mux/intel_pmc_mux.c
+++ b/drivers/usb/typec/mux/intel_pmc_mux.c
@@ -718,7 +718,7 @@ DEFINE_SHOW_ATTRIBUTE(port_iom_status);
static void pmc_mux_port_debugfs_init(struct pmc_usb_port *port)
{
struct dentry *debugfs_dir;
- char name[6];
+ char name[8];
snprintf(name, sizeof(name), "port%d", port->usb3_port - 1);