Skip to content

Commit

Permalink
drm/i915/gvt: Do not copy the uninitialized pointer from fb_info
Browse files Browse the repository at this point in the history
In the code the memcpy() function copied uninitialized pointer in fb_info
to dmabuf_obj->info. Later the pointer in dmabuf_obj->info will be
initialized. To make the code aligned with requirements of the klocwork
static code analyzer, the uninitialized pointer should be initialized
before memcpy().

v2:
- Initialize fb_info.obj in vgpu_get_plane_info(). (Colin Xu)

This patch fixed the critical issue #632 reported by klockwork.

Signed-off-by: Aleksei Gimbitskii <aleksei.gimbitskii@intel.com>
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Cc: Zhi Wang <zhi.a.wang@intel.com>
Cc: Colin Xu <colin.xu@intel.com>
Reviewed-by: Colin Xu <colin.xu@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
  • Loading branch information
Aleksei Gimbitskii authored and Zhenyu Wang committed Apr 25, 2019
1 parent 0cf8f58 commit d942024
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/i915/gvt/dmabuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ static int vgpu_get_plane_info(struct drm_device *dev,
struct intel_vgpu_cursor_plane_format c;
int ret, tile_height = 1;

memset(info, 0, sizeof(*info));

if (plane_id == DRM_PLANE_TYPE_PRIMARY) {
ret = intel_vgpu_decode_primary_plane(vgpu, &p);
if (ret)
Expand Down

0 comments on commit d942024

Please sign in to comment.