ed93193e5c78e728cde4bdf56ebc942c6c77e46d
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / freescale-imx / imx-vpu / 0001-vpu-io-fix-IOSystemInit-failure.patch
1 [PATCH] vpu-io: fix IOSystemInit failure
2
3 When using a kernel where user/kernel split is 3G/1G, the address
4 returned by IOGetVirtMem() can appear to be a negative int.
5
6 IOSystemInit() incorrectly checks the return value of IOGetVirtMem().
7 IOGetVirtMem() returns -1 on error (and not MAP_FAILED, nor any other
8 negative value.)
9
10 Fix that by correctly checking against -1 (and not MAP_FAILED!)
11
12 Signed-off-by: Gary Bisson <bisson.gary@gmail.com>
13 [yann.morin.1998@free.fr: expand the commit log]
14 Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
15 ---
16  vpu/vpu_io.c | 2 +-
17  1 file changed, 1 insertion(+), 1 deletion(-)
18
19 diff --git a/vpu/vpu_io.c b/vpu/vpu_io.c
20 index 8cbb571..14759da 100644
21 --- a/vpu/vpu_io.c
22 +++ b/vpu/vpu_io.c
23 @@ -265,7 +265,7 @@ int IOSystemInit(void *callback)
24                 goto err;
25         }
26  
27 -       if (IOGetVirtMem(&bit_work_addr) <= 0)
28 +       if (IOGetVirtMem(&bit_work_addr) == -1)
29                 goto err;
30  #endif
31         UnlockVpu(vpu_semap);
32