Skip to content

Commit 7646423

Browse files
author
Lucas De Marchi
committed
drm/xe/configfs: Fix engine class parsing
If mask is NULL, only the engine class should be accepted, so the pattern string should be completely parsed. This should fix passing e.g. rcs0 to ctx_restore_post_bb when it's only expecting the engine class. Reported-by: Jonathan Cavitt <[email protected]> Closes: https://lore.kernel.org/r/[email protected] Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/r/[email protected] Fixes: e2a9854 ("drm/xe/configfs: Allow to select by class only") Reviewed-by: Jonathan Cavitt <[email protected]> Reviewed-by: Raag Jadav <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lucas De Marchi <[email protected]> (cherry picked from commit dd79796) Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 7bd03e3 commit 7646423

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/gpu/drm/xe/xe_configfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,8 @@ static const struct engine_info *lookup_engine_info(const char *pattern, u64 *ma
324324
continue;
325325

326326
pattern += strlen(engine_info[i].cls);
327-
if (!mask && !*pattern)
328-
return &engine_info[i];
327+
if (!mask)
328+
return *pattern ? NULL : &engine_info[i];
329329

330330
if (!strcmp(pattern, "*")) {
331331
*mask = engine_info[i].mask;

0 commit comments

Comments
 (0)