Skip to content
Snippets Groups Projects
Commit 65e743d8 authored by Janusz Krzysztofik's avatar Janusz Krzysztofik
Browse files

lib/gem_engine_topology: Fix broken compare of device links

When looking for a primary counterpart of a render device, we compare
"device" links of both nodes.  If those links point to the same device
then we know we've found the correct primary node.

However, readlinkat() function we use doesn't explicitly terminate read in
strings with null characters, and then the comparison occasionally fails.

Process the second (potential primary counterpart) node only if its
"device" link is of the same length as that of the render node, and limit
the number of compared characters to that length.

Closes: drm/i915/kernel#6268


Signed-off-by: default avatarJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Reviewed-by: default avatarKamil Konieczny <kamil.konieczny@linux.intel.com>
parent 02a598bd
No related branches found
No related tags found
No related merge requests found
Pipeline #1228085 passed
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment