Skip to content

Commit f170bed

Browse files
lag-linarothierryreding
authored andcommitted
drm/tegra: hub: Increase buffer size to ensure all possible values can be stored
When converting from int to string, we must allow for up to 10-chars (2147483647). Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/tegra/hub.c: In function ‘tegra_display_hub_probe’: drivers/gpu/drm/tegra/hub.c:1106:47: warning: ‘%u’ directive output may be truncated writing between 1 and 10 bytes into a region of size 4 [-Wformat-truncation=] drivers/gpu/drm/tegra/hub.c:1106:42: note: directive argument in the range [0, 4294967294] drivers/gpu/drm/tegra/hub.c:1106:17: note: ‘snprintf’ output between 6 and 15 bytes into a destination of size 8 Signed-off-by: Lee Jones <lee@kernel.org> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230824073710.2677348-16-lee@kernel.org
1 parent 753c977 commit f170bed

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • drivers/gpu/drm/tegra

drivers/gpu/drm/tegra/hub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ static int tegra_display_hub_probe(struct platform_device *pdev)
11011101

11021102
for (i = 0; i < hub->soc->num_wgrps; i++) {
11031103
struct tegra_windowgroup *wgrp = &hub->wgrps[i];
1104-
char id[8];
1104+
char id[16];
11051105

11061106
snprintf(id, sizeof(id), "wgrp%u", i);
11071107
mutex_init(&wgrp->lock);

0 commit comments

Comments
 (0)