Commit 17ffcdb0 authored by Nirmoy Das's avatar Nirmoy Das Committed by Lucas De Marchi

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: default avatarNirmoy Das <nirmoy.das@intel.com>
Reviewed-by: default avatarMatthew Brost <matthew.brost@intel.com>
Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240131051838.24705-1-nirmoy.das@intel.com
parent db0adab0
...@@ -198,7 +198,7 @@ static int query_engines(struct xe_device *xe, ...@@ -198,7 +198,7 @@ static int query_engines(struct xe_device *xe,
return -EINVAL; return -EINVAL;
} }
engines = kmalloc(size, GFP_KERNEL); engines = kzalloc(size, GFP_KERNEL);
if (!engines) if (!engines)
return -ENOMEM; return -ENOMEM;
...@@ -212,14 +212,10 @@ static int query_engines(struct xe_device *xe, ...@@ -212,14 +212,10 @@ static int query_engines(struct xe_device *xe,
engines->engines[i].instance.engine_instance = engines->engines[i].instance.engine_instance =
hwe->logical_instance; hwe->logical_instance;
engines->engines[i].instance.gt_id = gt->info.id; 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++; i++;
} }
engines->pad = 0;
engines->num_engines = i; engines->num_engines = i;
if (copy_to_user(query_ptr, engines, size)) { if (copy_to_user(query_ptr, engines, size)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment