]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/i915: Make sure i915_ggtt_view is inited when creating an FB
authorImre Deak <imre.deak@intel.com>
Thu, 25 Mar 2021 21:47:47 +0000 (23:47 +0200)
committerImre Deak <imre.deak@intel.com>
Mon, 29 Mar 2021 19:54:50 +0000 (22:54 +0300)
This probably doesn't cause an issue, since the code checks the view
type dependent size of the views before comparing them, but let's follow
the practice to bzero the whole struct when initializing it.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210325214808.2071517-5-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_display.c

index 2bc8f292e0b7698dddbd228c9222923eab852a13..d77b01f8d4e646b4d7721f88e9c9c0cf348afb34 100644 (file)
@@ -1005,6 +1005,8 @@ intel_fill_fb_ggtt_view(struct i915_ggtt_view *view,
                        const struct drm_framebuffer *fb,
                        unsigned int rotation)
 {
+       memset(view, 0, sizeof(*view));
+
        view->type = I915_GGTT_VIEW_NORMAL;
        if (drm_rotation_90_or_270(rotation)) {
                view->type = I915_GGTT_VIEW_ROTATED;