summaryrefslogtreecommitdiff
path: root/lib/igt_kmod.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-12-13 13:41:21 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-12-13 13:42:05 +0000
commit6e716b7f5768bb0218d2b5934472ed462560f13b (patch)
tree9f59594af71672e5a63c281be28df4db6aba299e /lib/igt_kmod.c
parent2e2a7d0852abcdacacfb3ba18c38a09f746b20fe (diff)
lib/kselftest: Apply the filter to the test name
The filter needs to skip the embedded test number as well. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/igt_kmod.c')
-rw-r--r--lib/igt_kmod.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index b2d8913a..109fa81f 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -399,10 +399,6 @@ void igt_kselftests(const char *module_name,
if (!val || strncmp(val, param_prefix, prefix_len))
continue;
- if (filter &&
- strncmp(val + prefix_len, filter, strlen(filter)))
- continue;
-
offset = strlen(val) + 1;
tl = malloc(sizeof(*tl) + offset);
if (!tl)
@@ -418,6 +414,12 @@ void igt_kselftests(const char *module_name,
&tl->number, &offset) == 1)
tl->name += offset;
+ if (filter &&
+ strncmp(tl->name, filter, strlen(filter))) {
+ free(tl);
+ continue;
+ }
+
tests_add(tl, &tests);
}
kmod_module_info_free_list(pre);