Skip to content

Commit f9af8f0

Browse files
committed
drm/framebuffer: Fix use of uninitialized variable
smatch reports: drivers/gpu/drm/drm_framebuffer.c:654 drm_mode_getfb2_ioctl() error: uninitialized symbol 'ret'. 'ret' is possibly not set when there are no errors, causing the error above. I can't say if that ever happens in real-life, but in any case I think it is good to initialize 'ret' to 0. 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 1d3062f commit f9af8f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/drm_framebuffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ int drm_mode_getfb2_ioctl(struct drm_device *dev,
583583
struct drm_mode_fb_cmd2 *r = data;
584584
struct drm_framebuffer *fb;
585585
unsigned int i;
586-
int ret;
586+
int ret = 0;
587587

588588
if (!drm_core_check_feature(dev, DRIVER_MODESET))
589589
return -EINVAL;

0 commit comments

Comments
 (0)