The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / freescale-imx / imx-vpu / 0001-vpu-io-fix-IOSystemInit-failure.patch
diff --git a/cirros-testvm/src-cirros/buildroot-2015.05/package/freescale-imx/imx-vpu/0001-vpu-io-fix-IOSystemInit-failure.patch b/cirros-testvm/src-cirros/buildroot-2015.05/package/freescale-imx/imx-vpu/0001-vpu-io-fix-IOSystemInit-failure.patch
new file mode 100644 (file)
index 0000000..ed93193
--- /dev/null
@@ -0,0 +1,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);
+