0194-drm-vc4-Validate-that-WAIT_BO-padding-is-cleared.patch 795 B

12345678910111213141516171819202122232425
  1. From d0ec6706ad65b6d760da74f5d437d973fe1e8a23 Mon Sep 17 00:00:00 2001
  2. From: Eric Anholt <eric@anholt.net>
  3. Date: Mon, 25 Jan 2016 13:05:00 -0800
  4. Subject: [PATCH] drm/vc4: Validate that WAIT_BO padding is cleared.
  5. This is ABI future-proofing if we ever want to extend the pad to mean
  6. something.
  7. Signed-off-by: Eric Anholt <eric@anholt.net>
  8. ---
  9. drivers/gpu/drm/vc4/vc4_gem.c | 3 +++
  10. 1 file changed, 3 insertions(+)
  11. --- a/drivers/gpu/drm/vc4/vc4_gem.c
  12. +++ b/drivers/gpu/drm/vc4/vc4_gem.c
  13. @@ -761,6 +761,9 @@ vc4_wait_bo_ioctl(struct drm_device *dev
  14. struct drm_gem_object *gem_obj;
  15. struct vc4_bo *bo;
  16. + if (args->pad != 0)
  17. + return -EINVAL;
  18. +
  19. gem_obj = drm_gem_object_lookup(dev, file_priv, args->handle);
  20. if (!gem_obj) {
  21. DRM_ERROR("Failed to look up GEM BO %d\n", args->handle);