intel: Use memset instead of VG_CLEAR
PATCH 1/1 intel: Use memset instead of VG_CLEAR
From: Ian Romanick <[email protected]>
The ioctl expects that certain fields will be zeroed, so we should allow the helper function to actually work in non-Valgrind builds.
--- intel/intel_bufmgr_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
intel/intel_bufmgr_gem.c +1 -1
@@ -3033,7 +3033,7 @@ drm_intel_get_reset_stats(drm_intel_context *ctx,if (ctx ==NULL )return -EINVAL ; -VG_CLEAR (stats); +memset (&stats,0 ,sizeof (stats)); bufmgr_gem = (drm_intel_bufmgr_gem *)ctx->bufmgr; stats.ctx_id = ctx->ctx_id;
Signature · 1 line
1.8.1.4
Quoted 9 lines · Ian Romanick
From: Ian Romanick <[email protected]>
The ioctl expects that certain fields will be zeroed, so we should allow the helper function to actually work in non-Valgrind builds.
Signed-off-by Ian Romanick <[email protected]>Reported-by Zhenyu Wang <[email protected]>Cc Damien Lespiau <[email protected]>Cc Daniel Vetter <[email protected]>
Quoted 20 lines
--- intel/intel_bufmgr_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)intel/intel_bufmgr_gem.c +1
-1@@ -3033,7 +3033,7 @@ drm_intel_get_reset_stats(drm_intel_context *ctx,if (ctx ==NULL )return -EINVAL ; -VG_CLEAR (stats); +memset (&stats,0 ,sizeof (stats)); bufmgr_gem = (drm_intel_bufmgr_gem *)ctx->bufmgr; stats.ctx_id = ctx->ctx_id;Signature · 1 line
1.8.1.4
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Quoted 9 lines · Ian Romanick
From: Ian Romanick <[email protected]>
The ioctl expects that certain fields will be zeroed, so we should allow the helper function to actually work in non-Valgrind builds.
Signed-off-by Ian Romanick <[email protected]>Reported-by Zhenyu Wang <[email protected]>Cc Damien Lespiau <[email protected]>Cc Daniel Vetter <[email protected]>
I was thinking that I missed it in the (lidrm) review, but it's actually a newer patch that introduces the checks.
Lesson learned for next ioctl reviews (kernel), have a better pass on the input validation and think about rejecting reserved values.
Quoted 20 lines
--- intel/intel_bufmgr_gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)intel/intel_bufmgr_gem.c +1
-1@@ -3033,7 +3033,7 @@ drm_intel_get_reset_stats(drm_intel_context *ctx,if (ctx ==NULL )return -EINVAL ; -VG_CLEAR (stats); +memset (&stats,0 ,sizeof (stats)); bufmgr_gem = (drm_intel_bufmgr_gem *)ctx->bufmgr; stats.ctx_id = ctx->ctx_id;Signature · 1 line
1.8.1.4