diff options
| author | Bommu Krishnaiah <krishnaiah.bommu@intel.com> | 2023-12-10 05:29:48 +0530 |
|---|---|---|
| committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2024-04-04 14:54:51 -0400 |
| commit | a3c86b6d7b1c8ffb46ffd34c3dbe9252da87956b (patch) | |
| tree | 8a5189be7cb9f83c487f07e9372cfadeb142e201 /drivers/gpu/drm/xe/xe_debugfs.c | |
| parent | 972d01d0e357f3799203fa64ab696ac035e16803 (diff) | |
| download | lwn-a3c86b6d7b1c8ffb46ffd34c3dbe9252da87956b.tar.gz lwn-a3c86b6d7b1c8ffb46ffd34c3dbe9252da87956b.zip | |
drm/xe: prefer snprintf over sprintf
since the sprintf() function lacks built-in protection against buffer
overflows using the snprintf() function.
v2: Removed hard coded values and used sizeof()
Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: Tejas Upadhyay <tejas.upadhyay@intel.com>
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231209235949.54524-2-krishnaiah.bommu@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_debugfs.c')
| -rw-r--r-- | drivers/gpu/drm/xe/xe_debugfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/xe/xe_debugfs.c b/drivers/gpu/drm/xe/xe_debugfs.c index 8abdf3c17e1d..86150cafe0ff 100644 --- a/drivers/gpu/drm/xe/xe_debugfs.c +++ b/drivers/gpu/drm/xe/xe_debugfs.c @@ -129,7 +129,7 @@ void xe_debugfs_register(struct xe_device *xe) if (man) { char name[16]; - sprintf(name, "vram%d_mm", mem_type - XE_PL_VRAM0); + snprintf(name, sizeof(name), "vram%d_mm", mem_type - XE_PL_VRAM0); ttm_resource_manager_create_debugfs(man, root, name); } } |
