summaryrefslogtreecommitdiffstats
path: root/package/freescale-imx/imx-vpu/imx-vpu-0001-vpu-io-fix-IOSystemInit-failure.patch
blob: ed93193e5c78e728cde4bdf56ebc942c6c77e46d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
[PATCH] vpu-io: fix IOSystemInit failure

When using a kernel where user/kernel split is 3G/1G, the address
returned by IOGetVirtMem() can appear to be a negative int.

IOSystemInit() incorrectly checks the return value of IOGetVirtMem().
IOGetVirtMem() returns -1 on error (and not MAP_FAILED, nor any other
negative value.)

Fix that by correctly checking against -1 (and not MAP_FAILED!)

Signed-off-by: Gary Bisson <bisson.gary@gmail.com>
[yann.morin.1998@free.fr: expand the commit log]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 vpu/vpu_io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vpu/vpu_io.c b/vpu/vpu_io.c
index 8cbb571..14759da 100644
--- a/vpu/vpu_io.c
+++ b/vpu/vpu_io.c
@@ -265,7 +265,7 @@ int IOSystemInit(void *callback)
 		goto err;
 	}
 
-	if (IOGetVirtMem(&bit_work_addr) <= 0)
+	if (IOGetVirtMem(&bit_work_addr) == -1)
 		goto err;
 #endif
 	UnlockVpu(vpu_semap);

OpenPOWER on IntegriCloud