Skip to content

Commit 1d3062f

Browse files
committed
drm/drm_file: fix use of uninitialized variable
smatch reports: drivers/gpu/drm/drm_file.c:967 drm_show_memory_stats() error: uninitialized symbol 'supported_status'. 'supported_status' is only set in one code path. I'm not familiar with the code to say if that path will always be ran in real life, but whether that is the case or not, I think it is good to initialize 'supported_status' to 0 to silence the warning (and possibly fix a bug). Reviewed-by: Laurent Pinchart <[email protected]> Acked-by: Maxime Ripard <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 28d3d06 commit 1d3062f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/drm_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ void drm_show_memory_stats(struct drm_printer *p, struct drm_file *file)
898898
{
899899
struct drm_gem_object *obj;
900900
struct drm_memory_stats status = {};
901-
enum drm_gem_object_status supported_status;
901+
enum drm_gem_object_status supported_status = 0;
902902
int id;
903903

904904
spin_lock(&file->table_lock);

0 commit comments

Comments
 (0)