Unverified Commit fe8401db authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14030 drm/vboxvideo: Replace fake VLA at end of vbva_mouse_pointer_shape with real VLA

parents e21b252f 23e6d285
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -135,7 +135,15 @@ int hgsmi_update_pointer_shape(struct gen_pool *ctx, u32 flags,
		flags |= VBOX_MOUSE_POINTER_VISIBLE;
	}

	p = hgsmi_buffer_alloc(ctx, sizeof(*p) + pixel_len, HGSMI_CH_VBVA,
	/*
	 * The 4 extra bytes come from switching struct vbva_mouse_pointer_shape
	 * from having a 4 bytes fixed array at the end to using a proper VLA
	 * at the end. These 4 extra bytes were not subtracted from sizeof(*p)
	 * before the switch to the VLA, so this way the behavior is unchanged.
	 * Chances are these 4 extra bytes are not necessary but they are kept
	 * to avoid regressions.
	 */
	p = hgsmi_buffer_alloc(ctx, sizeof(*p) + pixel_len + 4, HGSMI_CH_VBVA,
			       VBVA_MOUSE_POINTER_SHAPE);
	if (!p)
		return -ENOMEM;
+1 −3
Original line number Diff line number Diff line
@@ -351,10 +351,8 @@ struct vbva_mouse_pointer_shape {
	 * Bytes in the gap between the AND and the XOR mask are undefined.
	 * XOR mask scanlines have no gap between them and size of XOR mask is:
	 * xor_len = width * 4 * height.
	 *
	 * Preallocate 4 bytes for accessing actual data as p->data.
	 */
	u8 data[4];
	u8 data[];
} __packed;

/* pointer is visible */