summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@canonical.com>2012-08-14 18:48:48 +0200
committerMaarten Lankhorst <maarten.lankhorst@canonical.com>2012-08-14 18:48:48 +0200
commit0f65ee9576dcfe3f9b82dcda47fd8744874c4ccb (patch)
treea88b41c8232c263dadb3a91150f28d42e1b8c0b3 /tests
parentfc54f2eaa8f55ceb4955d31ef6d8b36645c6910f (diff)
fix crash with insufficient permissions
Diffstat (limited to 'tests')
-rw-r--r--tests/prime_nv_api.c4
-rw-r--r--tests/prime_nv_pcopy.c2
-rw-r--r--tests/prime_nv_test.c2
3 files changed, 8 insertions, 0 deletions
diff --git a/tests/prime_nv_api.c b/tests/prime_nv_api.c
index 7267e93f..5cd08135 100644
--- a/tests/prime_nv_api.c
+++ b/tests/prime_nv_api.c
@@ -324,9 +324,13 @@ int main(int argc, char **argv)
/* set up intel bufmgr */
bufmgr = drm_intel_bufmgr_gem_init(intel_fd, 4096);
+ if (!bufmgr)
+ return -1;
drm_intel_bufmgr_gem_enable_reuse(bufmgr);
bufmgr2 = drm_intel_bufmgr_gem_init(intel_fd2, 4096);
+ if (!bufmgr2)
+ return -1;
drm_intel_bufmgr_gem_enable_reuse(bufmgr2);
/* set up nouveau bufmgr */
diff --git a/tests/prime_nv_pcopy.c b/tests/prime_nv_pcopy.c
index 650ea24e..5da0066b 100644
--- a/tests/prime_nv_pcopy.c
+++ b/tests/prime_nv_pcopy.c
@@ -1285,6 +1285,8 @@ int main(int argc, char **argv)
/* set up intel bufmgr */
bufmgr = drm_intel_bufmgr_gem_init(intel_fd, 4096);
+ if (!bufmgr)
+ return -1;
drm_intel_bufmgr_gem_enable_reuse(bufmgr);
/* set up nouveau bufmgr */
diff --git a/tests/prime_nv_test.c b/tests/prime_nv_test.c
index 2e48db5b..4a3d0435 100644
--- a/tests/prime_nv_test.c
+++ b/tests/prime_nv_test.c
@@ -515,6 +515,8 @@ int main(int argc, char **argv)
/* set up intel bufmgr */
bufmgr = drm_intel_bufmgr_gem_init(intel_fd, 4096);
+ if (!bufmgr)
+ return -1;
drm_intel_bufmgr_gem_enable_reuse(bufmgr);
/* set up nouveau bufmgr */