From: Dominique Martinet <asmadeus@codewreck.org>
To: Chris Wilson <chris@chris-wilson.co.uk>,
Jani Nikula <jani.nikula@linux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: David Airlie <airlied@linux.ie>,
intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
Dominique Martinet <asmadeus@codewreck.org>
Subject: [PATCH v2] i915/intel_tv_get_modes: fix strncpy truncation warning
Date: Thu, 12 Jul 2018 01:24:46 +0200 [thread overview]
Message-ID: <1531351486-5932-1-git-send-email-asmadeus@codewreck.org> (raw)
In-Reply-To: <1531295175-24052-1-git-send-email-asmadeus@codewreck.org>
Change it to use strlcpy instead
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
---
drivers/gpu/drm/i915/intel_tv.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index b55b5c157e38..25fee7dba7e2 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -1355,8 +1355,7 @@ intel_tv_get_modes(struct drm_connector *connector)
mode_ptr = drm_mode_create(connector->dev);
if (!mode_ptr)
continue;
- strncpy(mode_ptr->name, input->name, DRM_DISPLAY_MODE_LEN);
- mode_ptr->name[DRM_DISPLAY_MODE_LEN - 1] = '\0';
+ strlcpy(mode_ptr->name, input->name, DRM_DISPLAY_MODE_LEN);
mode_ptr->hdisplay = hactive_s;
mode_ptr->hsync_start = hactive_s + 1;
--
2.17.1
next prev parent reply other threads:[~2018-07-11 23:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-11 7:46 [PATCH] " Dominique Martinet
2018-07-11 14:48 ` Chris Wilson
2018-07-11 23:24 ` Dominique Martinet [this message]
2018-07-12 7:39 ` [PATCH v2] " Chris Wilson
2018-07-12 9:19 ` Chris Wilson
2018-07-12 12:44 ` [Intel-gfx] [PATCH] " Ville Syrjälä
2018-07-12 13:55 ` Dominique Martinet
2018-07-12 14:10 ` Ville Syrjälä
2018-07-12 14:30 ` Dominique Martinet
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=1531351486-5932-1-git-send-email-asmadeus@codewreck.org \
--to=asmadeus@codewreck.org \
--cc=airlied@linux.ie \
--cc=chris@chris-wilson.co.uk \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rodrigo.vivi@intel.com \
/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
Powered by JetHome