Skip to content

Commit 1b50e10

Browse files
johnstultz-workshuahkh
authored andcommitted
kselftests: dmabuf-heaps: Softly fail if don't find a vgem device
While testing against a vgem device is helpful for testing importing they aren't always configured in, so don't make it a fatal failure. Cc: Shuah Khan <[email protected]> Cc: Brian Starkey <[email protected]> Cc: Sumit Semwal <[email protected]> Cc: Laura Abbott <[email protected]> Cc: Hridya Valsaraju <[email protected]> Cc: Suren Baghdasaryan <[email protected]> Cc: Sandeep Patil <[email protected]> Cc: Daniel Mentz <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: John Stultz <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 50c65a8 commit 1b50e10

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,14 @@ static int test_alloc_and_import(char *heap_name)
184184
if (importer_fd < 0) {
185185
ret = importer_fd;
186186
printf("Failed to open vgem\n");
187-
goto out;
188-
}
189-
190-
ret = import_vgem_fd(importer_fd, dmabuf_fd, &handle);
191-
if (ret < 0) {
192-
printf("Failed to import buffer\n");
193-
goto out;
187+
} else {
188+
ret = import_vgem_fd(importer_fd, dmabuf_fd, &handle);
189+
if (ret < 0) {
190+
printf("Failed to import buffer\n");
191+
goto out;
192+
}
193+
printf("import passed\n");
194194
}
195-
printf("import passed\n");
196195

197196
ret = dmabuf_sync(dmabuf_fd, DMA_BUF_SYNC_START);
198197
if (ret < 0) {

0 commit comments

Comments
 (0)