[PATCH v3 2/6] drm/i915/gvt: Do not copy the uninitialized pointer from fb_info
Zhenyu Wang
zhenyuw at linux.intel.com
Thu Apr 25 03:11:05 UTC 2019
On 2019.04.23 15:04:09 +0300, Aleksei Gimbitskii wrote:
> 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 at intel.com>
> Cc: Zhenyu Wang <zhenyuw at linux.intel.com>
> Cc: Zhi Wang <zhi.a.wang at intel.com>
> Cc: Colin Xu <colin.xu at intel.com>
Pls carry any r-b received, so I don't need to check again,
I will pick up later.
thanks
> ---
> drivers/gpu/drm/i915/gvt/dmabuf.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/gvt/dmabuf.c b/drivers/gpu/drm/i915/gvt/dmabuf.c
> index 4e1e425189ba..93a89569f923 100644
> --- a/drivers/gpu/drm/i915/gvt/dmabuf.c
> +++ b/drivers/gpu/drm/i915/gvt/dmabuf.c
> @@ -211,6 +211,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)
> --
> 2.17.1
>
> ---------------------------------------------------------------------
> Intel Finland Oy
> Registered Address: PL 281, 00181 Helsinki
> Business Identity Code: 0357606 - 4
> Domiciled in Helsinki
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>
> _______________________________________________
> intel-gvt-dev mailing list
> intel-gvt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev
--
Open Source Technology Center, Intel ltd.
$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20190425/ac445320/attachment.sig>
More information about the intel-gvt-dev
mailing list