buildrootschalter/package/freescale-imx/imx-vpu/imx-vpu-0001-vpu-io-fix-IOSystemInit-failure.patch
Gary Bisson b701f89eb8 freescale-imx: add imx-vpu package
As of 3.10.17-1.0.0 release, VPU code is now in its own package.

Signed-off-by: Gary Bisson <bisson.gary@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
[yann.morin.1998@free.fr: slightly rework the kconfig comment; fold the
 imx-vpu patches into this changeset; add one missing license file]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Hadrien Boutteville <hadrien.boutteville@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-15 23:09:42 +02:00

33 lines
932 B
Diff

[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);