1 From 7ca66c10c05168c7d342df7c7a70d4a1ae0629f7 Mon Sep 17 00:00:00 2001
2 From: Eric Nelson <eric.nelson@boundarydevices.com>
3 Date: Sat, 28 Jun 2014 09:45:09 -0700
4 Subject: [PATCH] vpu_wrapper: fix tests of return value from IOGetVirtMem
6 IOGetVirtMem() returns a pointer or specifically -1 (MAP_FAILED)
7 in the case of failure.
9 This problem is being discussed upstream at
10 https://lists.yoctoproject.org/pipermail/meta-freescale/2014-June/008993.html.
12 Upstream-Status: Pending
14 Signed-off-by: Laci Tele <laci@boundarydevices.com>
15 Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
17 vpu_wrapper.c | 4 ++--
18 1 file changed, 2 insertions(+), 2 deletions(-)
20 diff --git a/vpu_wrapper.c b/vpu_wrapper.c
21 index 9249174..148c5df 100755
24 @@ -6653,7 +6653,7 @@ VpuDecRetCode VPU_DecGetMem(VpuMemDesc* pInOutMem)
25 return VPU_DEC_RET_FAILURE;
27 ret=IOGetVirtMem(&buff);
28 - if(ret==0) //if(ret!=RETCODE_SUCCESS)
29 + if(ret == -1) //if(ret==MAP_FAILED)
31 VPU_ERROR("%s: get virtual memory failure: size=%d, ret=%d \r\n",__FUNCTION__,buff.size,ret);
32 return VPU_DEC_RET_FAILURE;
33 @@ -8277,7 +8277,7 @@ VpuEncRetCode VPU_EncGetMem(VpuMemDesc* pInOutMem)
34 return VPU_ENC_RET_FAILURE;
36 ret=IOGetVirtMem(&buff);
37 - if(ret==0) //if(ret!=RETCODE_SUCCESS)
38 + if(ret == -1) //if(ret==MAP_FAILED)
40 VPU_ENC_ERROR("%s: get virtual memory failure: size=%d, ret=%d \r\n",__FUNCTION__,buff.size,(UINT32)ret);
41 return VPU_ENC_RET_FAILURE;