Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] libfslvpuwrap: fix tests of return value from IOGetVirtMem
@ 2014-07-25  6:43 Gary Bisson
  2014-07-25 16:55 ` Yann E. MORIN
  2014-07-26  7:33 ` Thomas Petazzoni
  0 siblings, 2 replies; 5+ messages in thread
From: Gary Bisson @ 2014-07-25  6:43 UTC (permalink / raw)
  To: buildroot

Same as similar patches for imx-vpu, the returned value from
IOGetVirtMem was not properly checked.

Signed-off-by: Gary Bisson <bisson.gary@gmail.com>

---
Yann, Eric, all,
This patch is just a copy of what Eric pushed for this package in Yocto.
Thanks,
Gary
---
 ...-fix-tests-of-return-value-from-IOGetVirt.patch | 41 ++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 package/libfslvpuwrap/libfslvpuwrap-0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch

diff --git a/package/libfslvpuwrap/libfslvpuwrap-0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch b/package/libfslvpuwrap/libfslvpuwrap-0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch
new file mode 100644
index 0000000..ccd2d9e
--- /dev/null
+++ b/package/libfslvpuwrap/libfslvpuwrap-0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch
@@ -0,0 +1,41 @@
+From 7ca66c10c05168c7d342df7c7a70d4a1ae0629f7 Mon Sep 17 00:00:00 2001
+From: Eric Nelson <eric.nelson@boundarydevices.com>
+Date: Sat, 28 Jun 2014 09:45:09 -0700
+Subject: [PATCH] vpu_wrapper: fix tests of return value from IOGetVirtMem
+
+IOGetVirtMem() returns a pointer or specifically -1 (MAP_FAILED)
+in the case of failure.
+
+Upstream-Status: Pending
+
+Signed-off-by: Laci Tele <laci@boundarydevices.com>
+Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
+---
+ vpu_wrapper.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/vpu_wrapper.c b/vpu_wrapper.c
+index 9249174..148c5df 100755
+--- a/vpu_wrapper.c
++++ b/vpu_wrapper.c
+@@ -6653,7 +6653,7 @@ VpuDecRetCode VPU_DecGetMem(VpuMemDesc* pInOutMem)
+ 		return VPU_DEC_RET_FAILURE;
+ 	}
+ 	ret=IOGetVirtMem(&buff);
+-	if(ret==0) //if(ret!=RETCODE_SUCCESS)
++	if(ret == -1) //if(ret==MAP_FAILED)
+ 	{
+ 		VPU_ERROR("%s: get virtual memory failure: size=%d, ret=%d \r\n",__FUNCTION__,buff.size,ret);
+ 		return VPU_DEC_RET_FAILURE;
+@@ -8277,7 +8277,7 @@ VpuEncRetCode VPU_EncGetMem(VpuMemDesc* pInOutMem)
+ 		return VPU_ENC_RET_FAILURE;
+ 	}
+ 	ret=IOGetVirtMem(&buff);
+-	if(ret==0) //if(ret!=RETCODE_SUCCESS)
++	if(ret == -1) //if(ret==MAP_FAILED)
+ 	{
+ 		VPU_ENC_ERROR("%s: get virtual memory failure: size=%d, ret=%d \r\n",__FUNCTION__,buff.size,(UINT32)ret);
+ 		return VPU_ENC_RET_FAILURE;
+-- 
+1.9.1
+
-- 
2.0.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-07-26  7:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-25  6:43 [Buildroot] [PATCH] libfslvpuwrap: fix tests of return value from IOGetVirtMem Gary Bisson
2014-07-25 16:55 ` Yann E. MORIN
2014-07-25 17:01   ` Eric Nelson
2014-07-25 17:26     ` Yann E. MORIN
2014-07-26  7:33 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox