diff options
author | Tomi Valkeinen <[email protected]> | 2023-11-03 15:14:04 +0200 |
---|---|---|
committer | Tomi Valkeinen <[email protected]> | 2023-12-07 09:21:43 +0200 |
commit | f9af8f0c1dc567a5a6a6318ff324c45d80d4a60f (patch) | |
tree | 6178b9b8f317ddef4c5223db7915c354287ad1f5 | |
parent | 1d3062fad9c7313fff9970a88e0538a24480ffb8 (diff) |
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]
-rw-r--r-- | drivers/gpu/drm/drm_framebuffer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 09e289fca5c3..3cc0ffc28e86 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -583,7 +583,7 @@ int drm_mode_getfb2_ioctl(struct drm_device *dev, struct drm_mode_fb_cmd2 *r = data; struct drm_framebuffer *fb; unsigned int i; - int ret; + int ret = 0; if (!drm_core_check_feature(dev, DRIVER_MODESET)) return -EINVAL; |