summaryrefslogtreecommitdiff
path: root/tests/prime_nv_api.c
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/prime_nv_api.c
parentfc54f2eaa8f55ceb4955d31ef6d8b36645c6910f (diff)
fix crash with insufficient permissions
Diffstat (limited to 'tests/prime_nv_api.c')
-rw-r--r--tests/prime_nv_api.c4
1 files changed, 4 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 */