]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
drm/msm: use strscpy instead of strncpy
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Wed, 18 Jan 2023 02:01:52 +0000 (04:01 +0200)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tue, 24 Jan 2023 08:11:52 +0000 (10:11 +0200)
commitd7fd8634f48d76aa799ed57beb7d87dab91bde80
tree854bc6325d36e9bcb0f45e6c452ee20d531f33b9
parent255f056181ac69278dcd8778f0be32a21b2d2a6a
drm/msm: use strscpy instead of strncpy

Using strncpy can result in non-NULL-terminated destination string. Use
strscpy instead. This fixes following warning:

drivers/gpu/drm/msm/msm_fence.c: In function ‘msm_fence_context_alloc’:
drivers/gpu/drm/msm/msm_fence.c:25:9: warning: ‘strncpy’ specified bound 32 equals destination size [-Wstringop-truncation]
   25 |         strncpy(fctx->name, name, sizeof(fctx->name));
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: f97decac5f4c ("drm/msm: Support multiple ringbuffers")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/518787/
Link: https://lore.kernel.org/r/20230118020152.1689213-1-dmitry.baryshkov@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drivers/gpu/drm/msm/msm_fence.c