]> code.ossystems Code Review - meta-freescale.git/blob
ccd2d9ee7d1d55ffe9cad3a251251bceafc66c0e
[meta-freescale.git] /
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
5
6 IOGetVirtMem() returns a pointer or specifically -1 (MAP_FAILED)
7 in the case of failure.
8
9 Upstream-Status: Pending
10
11 Signed-off-by: Laci Tele <laci@boundarydevices.com>
12 Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
13 ---
14  vpu_wrapper.c | 4 ++--
15  1 file changed, 2 insertions(+), 2 deletions(-)
16
17 diff --git a/vpu_wrapper.c b/vpu_wrapper.c
18 index 9249174..148c5df 100755
19 --- a/vpu_wrapper.c
20 +++ b/vpu_wrapper.c
21 @@ -6653,7 +6653,7 @@ VpuDecRetCode VPU_DecGetMem(VpuMemDesc* pInOutMem)
22                 return VPU_DEC_RET_FAILURE;
23         }
24         ret=IOGetVirtMem(&buff);
25 -       if(ret==0) //if(ret!=RETCODE_SUCCESS)
26 +       if(ret == -1) //if(ret==MAP_FAILED)
27         {
28                 VPU_ERROR("%s: get virtual memory failure: size=%d, ret=%d \r\n",__FUNCTION__,buff.size,ret);
29                 return VPU_DEC_RET_FAILURE;
30 @@ -8277,7 +8277,7 @@ VpuEncRetCode VPU_EncGetMem(VpuMemDesc* pInOutMem)
31                 return VPU_ENC_RET_FAILURE;
32         }
33         ret=IOGetVirtMem(&buff);
34 -       if(ret==0) //if(ret!=RETCODE_SUCCESS)
35 +       if(ret == -1) //if(ret==MAP_FAILED)
36         {
37                 VPU_ENC_ERROR("%s: get virtual memory failure: size=%d, ret=%d \r\n",__FUNCTION__,buff.size,(UINT32)ret);
38                 return VPU_ENC_RET_FAILURE;
39 -- 
40 1.9.1
41