All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gary Bisson <bisson.gary@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 11/11] imx-vpu: fix IOGetVirtMem return value checks
Date: Thu, 26 Jun 2014 22:24:54 -0700	[thread overview]
Message-ID: <1403846694-21974-12-git-send-email-bisson.gary@gmail.com> (raw)
In-Reply-To: <1403846694-21974-1-git-send-email-bisson.gary@gmail.com>

buffer address can be < 0 when using a 3G/1G split. Fix the test by
checking against -1 instead.

Signed-off-by: Gary Bisson <bisson.gary@gmail.com>
---
 ...-lib-fix-IOGetVirtMem-return-value-checks.patch | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 package/freescale-imx/imx-vpu/imx-vpu-0002-vpu-lib-fix-IOGetVirtMem-return-value-checks.patch

diff --git a/package/freescale-imx/imx-vpu/imx-vpu-0002-vpu-lib-fix-IOGetVirtMem-return-value-checks.patch b/package/freescale-imx/imx-vpu/imx-vpu-0002-vpu-lib-fix-IOGetVirtMem-return-value-checks.patch
new file mode 100644
index 0000000..306524f
--- /dev/null
+++ b/package/freescale-imx/imx-vpu/imx-vpu-0002-vpu-lib-fix-IOGetVirtMem-return-value-checks.patch
@@ -0,0 +1,51 @@
+[PATCH] vpu-lib: fix IOGetVirtMem return value checks
+
+buffer address can be < 0 when using a 3G/1G split. Fix the test by
+checking against -1 instead.
+
+Signed-off-by: Gary Bisson <bisson.gary@gmail.com>
+---
+ vpu/vpu_lib.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/vpu/vpu_lib.c b/vpu/vpu_lib.c
+index 1fb731b..7a7f42d 100644
+--- a/vpu/vpu_lib.c
++++ b/vpu/vpu_lib.c
+@@ -1764,7 +1764,7 @@ RetCode vpu_EncStartOneFrame(EncHandle handle, EncParam * param)
+ 				err_msg("Unable to obtain physical mem\n");
+ 				return RETCODE_FAILURE;
+ 			}
+-			if (IOGetVirtMem(&pEncInfo->picParaBaseMem) <= 0) {
++			if (IOGetVirtMem(&pEncInfo->picParaBaseMem) == -1) {
+ 				IOFreePhyMem(&pEncInfo->picParaBaseMem);
+ 				pEncInfo->picParaBaseMem.phy_addr = 0;
+ 				err_msg("Unable to obtain virtual mem\n");
+@@ -2982,7 +2982,7 @@ RetCode vpu_DecGetInitialInfo(DecHandle handle, DecInitialInfo * info)
+ 			UnlockVpu(vpu_semap);
+ 			return RETCODE_FAILURE;
+ 		}
+-		if (IOGetVirtMem(&pDecInfo->userDataBufMem) <= 0) {
++		if (IOGetVirtMem(&pDecInfo->userDataBufMem) == -1) {
+ 			IOFreePhyMem(&pDecInfo->userDataBufMem);
+ 			pDecInfo->userDataBufMem.phy_addr = 0;
+ 			err_msg("Unable to obtain virtual mem\n");
+@@ -4017,7 +4017,7 @@ RetCode vpu_DecStartOneFrame(DecHandle handle, DecParam * param)
+ 				UnlockVpu(vpu_semap);
+ 				return RETCODE_FAILURE;
+ 			}
+-			if (IOGetVirtMem(&pDecInfo->picParaBaseMem) <= 0) {
++			if (IOGetVirtMem(&pDecInfo->picParaBaseMem) == -1) {
+ 				IOFreePhyMem(&pDecInfo->picParaBaseMem);
+ 				pDecInfo->picParaBaseMem.phy_addr = 0;
+ 				err_msg("Unable to obtain virtual mem\n");
+@@ -4057,7 +4057,7 @@ RetCode vpu_DecStartOneFrame(DecHandle handle, DecParam * param)
+ 			UnlockVpu(vpu_semap);
+ 			return RETCODE_FAILURE;
+ 		}
+-		if (IOGetVirtMem(&pDecInfo->userDataBufMem) <= 0) {
++		if (IOGetVirtMem(&pDecInfo->userDataBufMem) == -1) {
+ 			IOFreePhyMem(&pDecInfo->userDataBufMem);
+ 			pDecInfo->userDataBufMem.phy_addr = 0;
+ 			err_msg("Unable to obtain virtual mem\n");
+
-- 
2.0.0

  parent reply	other threads:[~2014-06-27  5:24 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-19  4:03 [Buildroot] [PATCH 0/5] freescale: update userspace packages Gary Bisson
2014-06-19  4:03 ` [Buildroot] [PATCH 1/5] freescale-imx: bump to version 3.10.17-1.0.0 Gary Bisson
2014-06-19 16:20   ` Yann E. MORIN
2014-06-20  2:40     ` Gary Bisson
2014-06-20 21:01       ` Yann E. MORIN
2014-06-21  3:44         ` Eric Nelson
2014-06-19  4:03 ` [Buildroot] [PATCH 2/5] libfslvpuwrap: bump to version 1.0.46 Gary Bisson
2014-06-19  4:03 ` [Buildroot] [PATCH 3/5] libfslcodec: bump to version 3.0.11 Gary Bisson
2014-06-19  4:03 ` [Buildroot] [PATCH 4/5] libfslparser: " Gary Bisson
2014-06-19  4:03 ` [Buildroot] [PATCH 5/5] gst-fsl-plugins: " Gary Bisson
2014-06-20 21:12   ` Yann E. MORIN
2014-06-27  5:24 ` [Buildroot] [PATCH v2 00/11] freescale: update userspace packages Gary Bisson
2014-06-27  5:24   ` [Buildroot] [PATCH v2 01/11] libfslvpuwrap: change version to be independent Gary Bisson
2014-06-29 19:01     ` Yann E. MORIN
2014-06-27  5:24   ` [Buildroot] [PATCH v2 02/11] freescale-imx: bump to version 3.10.17-1.0.0 Gary Bisson
2014-06-27  5:24   ` [Buildroot] [PATCH v2 03/11] freescale-imx: update imx-lib package Gary Bisson
2014-06-27  5:24   ` [Buildroot] [PATCH v2 04/11] freescale-imx: change platform choice to be common Gary Bisson
2014-06-27  5:24   ` [Buildroot] [PATCH v2 05/11] freescale-imx: add imx-vpu package Gary Bisson
2014-06-27  5:24   ` [Buildroot] [PATCH v2 06/11] libfslvpuwrap: bump to version 1.0.46 Gary Bisson
2014-06-27  5:24   ` [Buildroot] [PATCH v2 07/11] libfslcodec: bump to version 3.0.11 Gary Bisson
2014-06-27  5:24   ` [Buildroot] [PATCH v2 08/11] libfslparser: " Gary Bisson
2014-06-27  5:24   ` [Buildroot] [PATCH v2 09/11] gst-fsl-plugins: " Gary Bisson
2014-06-27  5:24   ` [Buildroot] [PATCH v2 10/11] imx-vpu: fix IOSystemInit failure Gary Bisson
2014-06-27  5:24   ` Gary Bisson [this message]
2014-06-29 19:04   ` [Buildroot] [PATCH v2 00/11] freescale: update userspace packages Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1403846694-21974-12-git-send-email-bisson.gary@gmail.com \
    --to=bisson.gary@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.