aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/qxl
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2021-06-08 17:13:13 +0100
committerGerd Hoffmann <kraxel@redhat.com>2021-06-09 08:52:07 +0200
commitfbbf23ddb2a1cc0c12c9f78237d1561c24006f50 (patch)
tree0cfdc8ae7d414a7f8e1de63c74b3566162d63be9 /drivers/gpu/drm/qxl
parentdrm/stm: Remove usage of drm_display_mode_to_videomode() (diff)
downloadlinux-dev-fbbf23ddb2a1cc0c12c9f78237d1561c24006f50.tar.xz
linux-dev-fbbf23ddb2a1cc0c12c9f78237d1561c24006f50.zip
drm: qxl: ensure surf.data is ininitialized
The object surf is not fully initialized and the uninitialized field surf.data is being copied by the call to qxl_bo_create via the call to qxl_gem_object_create. Set surf.data to zero to ensure garbage data from the stack is not being copied. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: f64122c1f6ad ("drm: add new QXL driver. (v1.4)") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: http://patchwork.freedesktop.org/patch/msgid/20210608161313.161922-1-colin.king@canonical.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/qxl')
-rw-r--r--drivers/gpu/drm/qxl/qxl_dumb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/qxl/qxl_dumb.c b/drivers/gpu/drm/qxl/qxl_dumb.c
index a635d9fdf8ac..d636ba685451 100644
--- a/drivers/gpu/drm/qxl/qxl_dumb.c
+++ b/drivers/gpu/drm/qxl/qxl_dumb.c
@@ -58,6 +58,8 @@ int qxl_mode_dumb_create(struct drm_file *file_priv,
surf.height = args->height;
surf.stride = pitch;
surf.format = format;
+ surf.data = 0;
+
r = qxl_gem_object_create_with_handle(qdev, file_priv,
QXL_GEM_DOMAIN_CPU,
args->size, &surf, &qobj,