aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirmoy Das <[email protected]>2024-01-31 06:18:38 +0100
committerLucas De Marchi <[email protected]>2024-02-02 22:44:55 -0800
commit17ffcdb041a4bce4db8f96552cbcf7ec8897490c (patch)
treef833abe995bc62f87a3b05ab44da8eb73dddc405
parentdb0adab049120e2df92420139538a22c8ee6faa0 (diff)
drm/xe/query: Use kzalloc for drm_xe_query_engines
Use kzalloc like other routines for better consistency. v2: Improve the subject(Matt) Signed-off-by: Nirmoy Das <[email protected]> Reviewed-by: Matthew Brost <[email protected]> Signed-off-by: Lucas De Marchi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/xe/xe_query.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
index 7e924faeeea0..4f1ab91dbec5 100644
--- a/drivers/gpu/drm/xe/xe_query.c
+++ b/drivers/gpu/drm/xe/xe_query.c
@@ -198,7 +198,7 @@ static int query_engines(struct xe_device *xe,
return -EINVAL;
}
- engines = kmalloc(size, GFP_KERNEL);
+ engines = kzalloc(size, GFP_KERNEL);
if (!engines)
return -ENOMEM;
@@ -212,14 +212,10 @@ static int query_engines(struct xe_device *xe,
engines->engines[i].instance.engine_instance =
hwe->logical_instance;
engines->engines[i].instance.gt_id = gt->info.id;
- engines->engines[i].instance.pad = 0;
- memset(engines->engines[i].reserved, 0,
- sizeof(engines->engines[i].reserved));
i++;
}
- engines->pad = 0;
engines->num_engines = i;
if (copy_to_user(query_ptr, engines, size)) {