Skip to content

Commit d093c01

Browse files
Vitaliy Triang3l Kuzminalexdeucher
authored andcommitted
drm/radeon/evergreen_cs: Add missing NULL prefix check in surface check
'evergreen_surface_check' is called with a NULL warning prefix when handling potentially recoverable issues or just to compute the alignment requirements, and 'evergreen_surface_check' is called again in case of failure (with the correct prefix, as opposed to NULL), therefore, the initial check must not print a warning, because the surface may be accepted successfully after having been corrected, however if it isn't, the final check will print the warning anyway. The surface check functions specific to array modes already implement this behavior, but the 'evergreen_surface_check' function itself doesn't. This is also supposed to fix the "'%s' directive argument is null [-Werror=format-overflow=]" compiler warning. Fixes: 285484e ("drm/radeon: add support for evergreen/ni tiling informations v11") Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Vitaliy Triang3l Kuzmin <ml@triang3l.ru> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit e20ea41)
1 parent b6a28b7 commit d093c01

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/gpu/drm/radeon/evergreen_cs.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,10 @@ static int evergreen_surface_check(struct radeon_cs_parser *p,
312312
case ARRAY_2D_TILED_THIN1:
313313
return evergreen_surface_check_2d(p, surf, prefix);
314314
default:
315-
dev_warn(p->dev, "%s:%d %s invalid array mode %d\n",
316-
__func__, __LINE__, prefix, surf->mode);
315+
if (prefix) {
316+
dev_warn(p->dev, "%s:%d %s invalid array mode %d\n",
317+
__func__, __LINE__, prefix, surf->mode);
318+
}
317319
return -EINVAL;
318320
}
319321
return -EINVAL;

0 commit comments

Comments
 (0)