diff options
author | Lionel Landwerlin <lionel.g.landwerlin@intel.com> | 2017-11-02 12:18:27 +0000 |
---|---|---|
committer | Lionel Landwerlin <lionel.g.landwerlin@intel.com> | 2017-11-02 14:52:58 +0000 |
commit | 49e43ef7c6e533c110a7ff8fa8096291ec1c0e0e (patch) | |
tree | dca398bde1c2deccbeecb8d23245bcb750749881 /drivers/gpu/drm/i915/i915_oa_kblgt2.c | |
parent | 820c5bbbf418fba41149fdeb870d623e21be2463 (diff) | |
download | linux-stable-49e43ef7c6e533c110a7ff8fa8096291ec1c0e0e.tar.gz linux-stable-49e43ef7c6e533c110a7ff8fa8096291ec1c0e0e.tar.bz2 linux-stable-49e43ef7c6e533c110a7ff8fa8096291ec1c0e0e.zip |
drm/i915: ensure oa config uuid is null terminated
Because dev_priv is 0-ed it's not currently an issue, but since we
have dev_priv->perf.oa.test_config.uuid size at uuid + 1, we could
just copy the null character.
v2: Use strlcpy instead of strncpy (Chris)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20171102121827.436-1-lionel.g.landwerlin@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/i915_oa_kblgt2.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_oa_kblgt2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_oa_kblgt2.c b/drivers/gpu/drm/i915/i915_oa_kblgt2.c index b6e7cc774136..2fa98a40bbc8 100644 --- a/drivers/gpu/drm/i915/i915_oa_kblgt2.c +++ b/drivers/gpu/drm/i915/i915_oa_kblgt2.c @@ -84,9 +84,9 @@ show_test_oa_id(struct device *kdev, struct device_attribute *attr, char *buf) void i915_perf_load_test_config_kblgt2(struct drm_i915_private *dev_priv) { - strncpy(dev_priv->perf.oa.test_config.uuid, + strlcpy(dev_priv->perf.oa.test_config.uuid, "baa3c7e4-52b6-4b85-801e-465a94b746dd", - UUID_STRING_LEN); + sizeof(dev_priv->perf.oa.test_config.uuid)); dev_priv->perf.oa.test_config.id = 1; dev_priv->perf.oa.test_config.mux_regs = mux_config_test_oa; |