summaryrefslogtreecommitdiff
path: root/external/drm/0001-kms-Return-a-negative-error-code-in-kms_bo_create.patch
diff options
context:
space:
mode:
Diffstat (limited to 'external/drm/0001-kms-Return-a-negative-error-code-in-kms_bo_create.patch')
-rw-r--r--external/drm/0001-kms-Return-a-negative-error-code-in-kms_bo_create.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/external/drm/0001-kms-Return-a-negative-error-code-in-kms_bo_create.patch b/external/drm/0001-kms-Return-a-negative-error-code-in-kms_bo_create.patch
new file mode 100644
index 0000000..f781bfd
--- /dev/null
+++ b/external/drm/0001-kms-Return-a-negative-error-code-in-kms_bo_create.patch
@@ -0,0 +1,32 @@
+From 9890239c820e31fde9d10fc66d2899ed7fbc60ef Mon Sep 17 00:00:00 2001
+From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Date: Thu, 1 Nov 2012 10:32:05 +0100
+Subject: [PATCH 1/4] kms: Return a negative error code in kms_bo_create()
+
+The function returns returns 0 on success or a negative value in case of an
+error, except when given invalid attributes in which case it returns the
+positive EINVAL value. Replace that with -EINVAL to allow the caller to detect
+errors with a < 0 check.
+
+Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
+---
+ libkms/api.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libkms/api.c b/libkms/api.c
+index 4a05f3d..5befaa0 100644
+--- a/libkms/api.c
++++ b/libkms/api.c
+@@ -80,7 +80,7 @@ int kms_bo_create(struct kms_driver *kms, const unsigned *attr, struct kms_bo **
+ type = value;
+ break;
+ default:
+- return EINVAL;
++ return -EINVAL;
+ }
+ }
+
+--
+1.7.12.4
+