Skip to content

Commit ce43cf3

Browse files
tobluxpatjak
authored andcommitted
drm/gma500: Replace deprecated strncpy() with strscpy()
strncpy() is deprecated for NUL-terminated destination buffers. Use strscpy() instead and remove the manual NUL-termination. Compile-tested only. Link: KSPP#90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Reviewed-by: Kees Cook <kees@kernel.org> Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250225203932.334123-1-thorsten.blum@linux.dev
1 parent f83a9b8 commit ce43cf3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/gpu/drm/gma500/cdv_intel_dp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -855,8 +855,7 @@ cdv_intel_dp_i2c_init(struct gma_connector *connector,
855855

856856
memset(&intel_dp->adapter, '\0', sizeof (intel_dp->adapter));
857857
intel_dp->adapter.owner = THIS_MODULE;
858-
strncpy (intel_dp->adapter.name, name, sizeof(intel_dp->adapter.name) - 1);
859-
intel_dp->adapter.name[sizeof(intel_dp->adapter.name) - 1] = '\0';
858+
strscpy(intel_dp->adapter.name, name);
860859
intel_dp->adapter.algo_data = &intel_dp->algo;
861860
intel_dp->adapter.dev.parent = connector->base.kdev;
862861

0 commit comments

Comments
 (0)