Skip to contentSkip to conversation

libfslvpuwrap: fix tests of return value from IOGetVirtMem

PATCH New Gary Bisson 4 participants 5 messages Jul 25, 2014 – Jul 26, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libfslvpuwrap: fix tests of return value from IOGetVirtMem

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

---
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
package/libfslvpuwrap/libfslvpuwrap-0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch new file +41 -0
new file mode 100644
index 0000000..ccd2d9e
@@ -0,0 +1,41 @@
+From 7ca66c10c05168c7d342df7c7a70d4a1ae0629f7 Mon Sep 17 00:00:00 2001
+From: Eric Nelson <[email protected]>
+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 <[email protected]>
+Signed-off-by: Eric Nelson <[email protected]>
+---
+ 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
+
Signature · 1 line
2.0.1
#1 lore raw

PATCH 1/1 libfslvpuwrap: fix tests of return value from IOGetVirtMem

Gary, All,

On 2014-07-24 23:43 -0700, Gary Bisson spake thusly:

Quoted 2 lines

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

That's the same problem as seen in imx-vpu and fixed by:
package/freescale-imx/imx-vpu/imx-vpu-0001-vpu-io-fix-IOSystemInit-failure.patch

right?

Quoted 18 lines

---
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
package/libfslvpuwrap/libfslvpuwrap-0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch new file +0 -0
new file mode 100644
index 0000000..ccd2d9e

package/libfslvpuwrap/libfslvpuwrap-0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch line 9

Quoted 9 lines
package/libfslvpuwrap/libfslvpuwrap-0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch new file +9 -0
@@ -0,0 +1,41 @@
+From 7ca66c10c05168c7d342df7c7a70d4a1ae0629f7 Mon Sep 17 00:00:00 2001
+From: Eric Nelson <[email protected]>
+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

Is there a public URL to the bug report or the patch submission? If so, can you paste the URL here, so we know when we update that we need to remove that patch?

With the URL added, you can add my:

Regards,
Yann E. MORIN.

Quoted 35 lines
package/libfslvpuwrap/libfslvpuwrap-0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch new file +32 -0
+
+Signed-off-by: Laci Tele <[email protected]>
+Signed-off-by: Eric Nelson <[email protected]>
+---
+ 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
+
Signature · 1 line
2.0.1
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 libfslvpuwrap: fix tests of return value from IOGetVirtMem

Hi Yann,

Quoted 4 lines · Yann E. MORIN

Gary, All,

<snip>

Quoted 17 lines

package/libfslvpuwrap/libfslvpuwrap-0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch line 9

Quoted 12 lines
package/libfslvpuwrap/libfslvpuwrap-0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch new file +9 -0
@@ -0,0 +1,41 @@
+From 7ca66c10c05168c7d342df7c7a70d4a1ae0629f7 Mon Sep 17 00:00:00 2001
+From: Eric Nelson <[email protected]>
+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

Is there a public URL to the bug report or the patch submission? If so, can you paste the URL here, so we know when we update that we need to remove that patch?

Since Freescale is now basing their releases on Yocto, the meta-freescale list is the best equivalent of "upstream" for these Freescale components.

Unfortunately, patches there are in a different form, and I pushed the equivalent forms and they were acked and promises made by Freescale (Lauren) to include in the next release:

	https://lists.yoctoproject.org/pipermail/meta-freescale/2014-June/thread.html#8881

Regards,

Eric

#3 lore raw

PATCH 1/1 libfslvpuwrap: fix tests of return value from IOGetVirtMem

Eric, All,

On 2014-07-25 10:01 -0700, Eric Nelson spake thusly:

Quoted 1 line · Yann E. MORIN

[--SNIP--]

Quoted 22 lines
Quoted 8 lines
Quoted 8 lines
package/libfslvpuwrap/libfslvpuwrap-0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch new file +5 -0
@@ -0,0 +1,41 @@
+From 7ca66c10c05168c7d342df7c7a70d4a1ae0629f7 Mon Sep 17 00:00:00 2001
+From: Eric Nelson <[email protected]>
+Date: Sat, 28 Jun 2014 09:45:09 -0700
+Subject: [PATCH] vpu_wrapper: fix tests of return value from IOGetVirtMem
+
Quoted 9 lines

package/libfslvpuwrap/libfslvpuwrap-0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch line 9

Quoted 4 lines
package/libfslvpuwrap/libfslvpuwrap-0001-vpu_wrapper-fix-tests-of-return-value-from-IOGetVirt.patch new file +4 -0
+IOGetVirtMem() returns a pointer or specifically -1 (MAP_FAILED)
+in the case of failure.
+
+Upstream-Status: Pending

Is there a public URL to the bug report or the patch submission? If so, can you paste the URL here, so we know when we update that we need to remove that patch?

Since Freescale is now basing their releases on Yocto, the meta-freescale list is the best equivalent of "upstream" for these Freescale components.

Quoted 6 lines

Unfortunately, patches there are in a different form, and I pushed the equivalent forms and they were acked and promises made by Freescale (Lauren) to include in the next release:

	https://lists.yoctoproject.org/pipermail/meta-freescale/2014-June/thread.html#8881

Great! We can add this to the patch description:

    https://lists.yoctoproject.org/pipermail/meta-freescale/2014-June/008993.html

where Freescale said "The patch is good. Team said they'll push it into our upcoming beta release."

I guess this is easy enough that it does not warrant a resend of the patch, so the two URLs above can be added by whoever commits that to the tree.

Thanks! ;-)

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH 1/1 libfslvpuwrap: fix tests of return value from IOGetVirtMem

In reply to Gary Bisson

Dear Gary Bisson,

Quoted 4 lines · Gary Bisson

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

Thanks, patch applied, after adding the reference to the upstream discussion, as suggested by Yann.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com