This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: v4l2-compliance: VIDIOC_S_EDID and invalid pointers
Author:  Hans Verkuil <hans.verk...@cisco.com>
Date:    Fri Feb 23 10:16:55 2018 +0100

Test what happens when the edid pointer is NULL or 0xdeadbeef.

Signed-off-by: Hans Verkuil <hans.verk...@cisco.com>

 utils/v4l2-compliance/v4l2-test-io-config.cpp | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=ef45319c1686088a46325db4dbfaffcdbcacf862
diff --git a/utils/v4l2-compliance/v4l2-test-io-config.cpp 
b/utils/v4l2-compliance/v4l2-test-io-config.cpp
index 401329bae86b..63e96253da65 100644
--- a/utils/v4l2-compliance/v4l2-test-io-config.cpp
+++ b/utils/v4l2-compliance/v4l2-test-io-config.cpp
@@ -575,14 +575,22 @@ static int checkEdid(struct node *node, unsigned pad, 
bool is_input)
        edid.pad = ~0;
        ret = doioctl(node, VIDIOC_S_EDID, &edid);
        fail_on_test(ret != EINVAL);
-       if (blocks == 256)
-               return 0;
-       edid.blocks = 256;
+       if (blocks < 256) {
+               edid.blocks = 256;
+               edid.pad = pad;
+               ret = doioctl(node, VIDIOC_S_EDID, &edid);
+               fail_on_test(ret != E2BIG);
+               fail_on_test(edid.blocks == 0 || edid.blocks >= 256);
+               fail_on_test(edid.pad != pad);
+       }
+       edid.blocks = blocks;
        edid.pad = pad;
+       edid.edid = NULL;
        ret = doioctl(node, VIDIOC_S_EDID, &edid);
-       fail_on_test(ret != E2BIG);
-       fail_on_test(edid.blocks == 0 || edid.blocks >= 256);
-       fail_on_test(edid.pad != pad);
+       fail_on_test(ret != EFAULT);
+       edid.edid = (__u8 *)0xdeadbeef;
+       ret = doioctl(node, VIDIOC_S_EDID, &edid);
+       fail_on_test(ret != EFAULT);
        return 0;
 }
 

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to