linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Pali Rohár" <pali@kernel.org>
Subject: [PATCH v1 3/4] Input: lifebook - increase size of phys
Date: Fri, 28 Feb 2025 14:07:46 +0200	[thread overview]
Message-ID: <20250228121147.242115-4-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20250228121147.242115-1-andriy.shevchenko@linux.intel.com>

When creating a physical device name in the driver the snprintf() takes
an up to 32 characters argument along with the additional 8 characters
and tries to pack this into 32 bytes array. GCC complains about that
when build with `make W=1`:

drivers/input/mouse/lifebook.c:282:9: note: ‘snprintf’ output between 8 and 39 bytes into a destination of size 32
 282 |         snprintf(priv->phys, sizeof(priv->phys),
     |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 283 |                  "%s/input1", psmouse->ps2dev.serio->phys);
     |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Increase the size to cover all possible cases.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/input/mouse/lifebook.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c
index 7147dacc404f..628a1b36a5da 100644
--- a/drivers/input/mouse/lifebook.c
+++ b/drivers/input/mouse/lifebook.c
@@ -21,7 +21,7 @@
 
 struct lifebook_data {
 	struct input_dev *dev2;		/* Relative device */
-	char phys[32];
+	char phys[40];
 };
 
 static bool lifebook_present;
-- 
2.47.2


  parent reply	other threads:[~2025-02-28 12:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-28 12:07 [PATCH v1 0/4] Input: Increase size of phys in the drivers Andy Shevchenko
2025-02-28 12:07 ` [PATCH v1 1/4] Input: ALPS - increase size of phys2 and phys3 Andy Shevchenko
2025-02-28 12:07 ` [PATCH v1 2/4] Input: atkbd - increase size of phys Andy Shevchenko
2025-02-28 12:07 ` Andy Shevchenko [this message]
2025-02-28 12:07 ` [PATCH v1 4/4] Input: psmouse " Andy Shevchenko
2025-02-28 12:52 ` [PATCH v1 0/4] Input: Increase size of phys in the drivers Andy Shevchenko
2025-03-04 12:14 ` Andy Shevchenko
2025-03-05  7:18   ` Dmitry Torokhov
2025-03-05 10:06     ` Andy Shevchenko
2025-03-26  9:48       ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250228121147.242115-4-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pali@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).