From patchwork Fri Jul 25 06:43:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Bisson X-Patchwork-Id: 373582 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 478DE140120 for ; Fri, 25 Jul 2014 16:43:25 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id DFF198AE17; Fri, 25 Jul 2014 06:43:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PHQeiX1uSUoj; Fri, 25 Jul 2014 06:43:22 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 09BB78ADDA; Fri, 25 Jul 2014 06:43:22 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 86E551BFA9E for ; Fri, 25 Jul 2014 06:43:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 81BAD8C1CE for ; Fri, 25 Jul 2014 06:43:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wCi9FokPjJ2X for ; Fri, 25 Jul 2014 06:43:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pd0-f177.google.com (mail-pd0-f177.google.com [209.85.192.177]) by whitealder.osuosl.org (Postfix) with ESMTPS id DB22889CF4 for ; Fri, 25 Jul 2014 06:43:19 +0000 (UTC) Received: by mail-pd0-f177.google.com with SMTP id p10so5130344pdj.36 for ; Thu, 24 Jul 2014 23:43:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=KKJqFC7zyuX/rYmdF4JHcALl6QICElidWUipzcVhrgw=; b=P8exp0mw08LcJzoOFZ6b2B8c82RC8r8lYSAa23Zn3mUyMHiGhul04GrCOL++/bUdvn 2oW9INhC3eal69R3ZdVIzDpi0qj7F2+Dt0yFyESD8BKnRpxqDdzEtLEUJZlpQttjUOVD 8Js64dpvpHOKg+2M7tlaOc4lDg8erXcGi/GdAEoec4s9ctuWLGRkIQ+BNfP0pHqidLfQ GFy2YwDAg3CPYVTJIB4mEd0TKTTt9J48OraO8qKT/KlMHyIhD+9KAuyOg9eCzsk+Q3uA 01xrvdNO0vYdToIHkz4zog3Xmf9HrWd939vGD5CZ4/hKs07wab/O4g5/sKES3XeQNTzZ 1Usg== X-Received: by 10.70.34.228 with SMTP id c4mr16308024pdj.76.1406270599641; Thu, 24 Jul 2014 23:43:19 -0700 (PDT) Received: from n411z.WORKGROUP. (c-24-22-143-40.hsd1.wa.comcast.net. [24.22.143.40]) by mx.google.com with ESMTPSA id ny7sm25043452pab.48.2014.07.24.23.43.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 24 Jul 2014 23:43:19 -0700 (PDT) From: Gary Bisson To: buildroot@busybox.net Date: Thu, 24 Jul 2014 23:43:13 -0700 Message-Id: <1406270593-17193-1-git-send-email-bisson.gary@gmail.com> X-Mailer: git-send-email 2.0.1 Cc: Gary Bisson , yann.morin.1998@free.fr Subject: [Buildroot] [PATCH] libfslvpuwrap: fix tests of return value from IOGetVirtMem X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Same as similar patches for imx-vpu, the returned value from IOGetVirtMem was not properly checked. Signed-off-by: Gary Bisson Acked-by: "Yann E. MORIN" --- 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 +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 +Signed-off-by: Eric Nelson +--- + 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 +