From patchwork Thu Jun 15 16:31:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 105678 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp890296qgd; Thu, 15 Jun 2017 09:37:52 -0700 (PDT) X-Received: by 10.98.67.86 with SMTP id q83mr6147601pfa.68.1497544672712; Thu, 15 Jun 2017 09:37:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497544672; cv=none; d=google.com; s=arc-20160816; b=ZRFJHvEOEHrMrfiaWNBzhokLkPF12yOitcVM4dTWceeieg3itQCyQzQYDZhjB9bIsu FOHWYJ3uxM75BBzdBPQ8bjXxLHw/wvY/6c3nfm07WWpolKH2xNvdJ14W+F8zjf6E7jLJ IVqbAs/cHXbW6pt84XcsAFmd16htifIeLN6NGkoLCjiy1Ei1Zk3acenh1ptddd4RkrOc K8+/NyI4xVV1sMF6iobDUCcyIMMCizkZF6CBkmxVWGkfyanr5poTCZG4IEBgcZZSj9QD mq4A279GjNBkbJEkA6ntqDi6zWB/bad+Dijgcf+b3iDNRo2DaHmEiWdoroS8ayojnEUn XHlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=V33cInNSB2HcpWDM/lkFdYAnGBmAXEh7rRQRSEwq33w=; b=fX11pRBzygW0uY+i6bDZ2zLLIX41ty4JSDkgZqACVkN/Tu7mo4uOVDKLah5uHoPOAH 1CPuPmxacDrWajYz6FGpcNbmV9/KkGZefcVuAssP2Nd8tWKKu9V5Pbedy8sBoIV7QedQ BqdaU/rAjwOD3QNigGlbwkPndDU1HtneRPlmi0zrgPQHDMfxrVBxVxbNXAlwmTBz6saA jd0aIb4JwQn1sY8TX1BiKBMr7CDDu3oJlcKQuyQaD0cPyxWfhKbiZ5NY3/wLr4aw8icl KlXo6hl/AeZlmKN8AZF5No+QzeRQQseqWV+0Wr1XSj7jtPYkwhFfl8TFHP1xHYg72dwL vt1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=Rft6Hjn3; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f23si392313pli.265.2017.06.15.09.37.52; Thu, 15 Jun 2017 09:37:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=Rft6Hjn3; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752478AbdFOQdK (ORCPT + 10 others); Thu, 15 Jun 2017 12:33:10 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:38459 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752391AbdFOQdE (ORCPT ); Thu, 15 Jun 2017 12:33:04 -0400 Received: by mail-wm0-f42.google.com with SMTP id n195so4095903wmg.1 for ; Thu, 15 Jun 2017 09:33:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sbLWg+U7sEmojvjXM6Y45XuFousaUUHw30lsyhJyDug=; b=Rft6Hjn36gxMGWjllkDMEeqkxwPdCygV3PUnRqo9lDAnM3OyjAa77qCZl5l/KaPoXj 5q6tPgqdt4Ex2D44qBp5aHbnKHQB0Uz2GFqiI1hAUo42irhSrHmb7dRuZhm0C7vImHMG 3/0+SxfgJR9rULCmnELNiVp/JRSqKjVKyQ+qU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sbLWg+U7sEmojvjXM6Y45XuFousaUUHw30lsyhJyDug=; b=J6ewZYP4XKyfXfSDA1vi5UilN2+eMZqGz3EthaVqK2B4Dhgy+Qp+OCRcG/ddIbhas8 V0LupfMZ7lcy0bIBCZMTOqdRugy37WCXKX4pg2cUVd7Slj1SxfEUenC0j8/hJdeg9rAi Qu3xsEDO15GLAQpfjGIwrmu5hP+uCUugS83lz/R/SSYy2pVK6AveNWmqurZR/6Fprj/+ CuGGPCpho43wezy5gBWTLolLvwHRFI+0f2Gkr+T08Vrqb4N5HMduamoTawAly8lH1Zie Jc5WI0cQaNvnsh+0uMWVAHXhidI1o9vXKieyGOg5d4GoLrdZTygMTY1cJdG01rJI3+Oi JtIw== X-Gm-Message-State: AKS2vOw8mGVmG/UySfUUif4dxGKADNtAUvC3+D44eOiWLvolVTeeY7gd kdVJDhIZ6lG6M86P X-Received: by 10.28.215.146 with SMTP id o140mr4312731wmg.16.1497544383511; Thu, 15 Jun 2017 09:33:03 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id m73sm541890wmi.25.2017.06.15.09.33.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Jun 2017 09:33:03 -0700 (PDT) From: Stanimir Varbanov To: Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Stanimir Varbanov Subject: [PATCH v11 09/19] media: venus: enable building of Venus video driver Date: Thu, 15 Jun 2017 19:31:50 +0300 Message-Id: <1497544320-2269-10-git-send-email-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497544320-2269-1-git-send-email-stanimir.varbanov@linaro.org> References: <1497544320-2269-1-git-send-email-stanimir.varbanov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This adds Venus driver Makefile and changes v4l2 platform Makefile/Kconfig in order to enable building of the driver. Note that in this initial version the COMPILE_TEST-ing is not supported because the drivers specific to ARM builds are still in process of enabling the aforementioned compile testing. Once that disadvantage is fixed the Venus driver compile testing will be possible with follow-up changes. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/Kconfig | 13 +++++++++++++ drivers/media/platform/Makefile | 2 ++ drivers/media/platform/qcom/venus/Makefile | 11 +++++++++++ 3 files changed, 26 insertions(+) create mode 100644 drivers/media/platform/qcom/venus/Makefile -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig index 8da521a8ead7..6027dbd4e04d 100644 --- a/drivers/media/platform/Kconfig +++ b/drivers/media/platform/Kconfig @@ -464,6 +464,19 @@ config VIDEO_TI_VPE_DEBUG ---help--- Enable debug messages on VPE driver. +config VIDEO_QCOM_VENUS + tristate "Qualcomm Venus V4L2 encoder/decoder driver" + depends on VIDEO_DEV && VIDEO_V4L2 && HAS_DMA + depends on ARCH_QCOM && IOMMU_DMA + select QCOM_MDT_LOADER + select VIDEOBUF2_DMA_SG + select V4L2_MEM2MEM_DEV + ---help--- + This is a V4L2 driver for Qualcomm Venus video accelerator + hardware. It accelerates encoding and decoding operations + on various Qualcomm SoCs. + To compile this driver as a module choose m here. + endif # V4L_MEM2MEM_DRIVERS # TI VIDEO PORT Helper Modules diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile index 6bbdf942e8c8..4607408c047d 100644 --- a/drivers/media/platform/Makefile +++ b/drivers/media/platform/Makefile @@ -81,3 +81,5 @@ obj-$(CONFIG_VIDEO_MEDIATEK_VCODEC) += mtk-vcodec/ obj-$(CONFIG_VIDEO_MEDIATEK_MDP) += mtk-mdp/ obj-$(CONFIG_VIDEO_MEDIATEK_JPEG) += mtk-jpeg/ + +obj-$(CONFIG_VIDEO_QCOM_VENUS) += qcom/venus/ diff --git a/drivers/media/platform/qcom/venus/Makefile b/drivers/media/platform/qcom/venus/Makefile new file mode 100644 index 000000000000..0fe9afb83697 --- /dev/null +++ b/drivers/media/platform/qcom/venus/Makefile @@ -0,0 +1,11 @@ +# Makefile for Qualcomm Venus driver + +venus-core-objs += core.o helpers.o firmware.o \ + hfi_venus.o hfi_msgs.o hfi_cmds.o hfi.o + +venus-dec-objs += vdec.o vdec_ctrls.o +venus-enc-objs += venc.o venc_ctrls.o + +obj-$(CONFIG_VIDEO_QCOM_VENUS) += venus-core.o +obj-$(CONFIG_VIDEO_QCOM_VENUS) += venus-dec.o +obj-$(CONFIG_VIDEO_QCOM_VENUS) += venus-enc.o From patchwork Thu Jun 15 16:31:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 105675 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp889697qgd; Thu, 15 Jun 2017 09:36:32 -0700 (PDT) X-Received: by 10.84.218.136 with SMTP id r8mr7187071pli.265.1497544592752; Thu, 15 Jun 2017 09:36:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497544592; cv=none; d=google.com; s=arc-20160816; b=Yn8FE8/HQl1O7HULGPO/8FC0xr0FoX07DAD8MwJ9p/3QNNMhX5e290v7MdeeR6w8CT vNkh/i4Tv04QmwVettpKXCKDRf7MFJLX2ZNrTfwJSl8j0ObKjgN+RfBvqAyr2YctjvmK pO34bZEulwI72DI84xWT6Q3OGaI//WvzyiRx3/pheqlOiSC+MsoBq6tDi/C+GV0z5tKW eyJKAM5Ge2TObfb+Qt98MSNTMwE2zREDyda/L7SDoiVBShBnbcoiDJ39bFQhuRvXopf4 VMHbaBLZlyrC4vzx0I7wayVU22wxgNN4VYNZOCiYHrXCb4NHGAFrudUoHYJuzzNSP0t8 /7/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=ASoBwd003NiCzBgJB/F4UIs6ueyEsoVuqMIB4UWs3OY=; b=P1rTpUgsIXBfl+S4glFSVnM81aBW1AMYIgUWpz3teHxQ4araxL2EGQLqVV2hci+RPf wL7OGrOvrY0RzzFNv67x3DeHa8ObH0XL5iY+A9yHl7NQMiI7yMfXwIUbPBcKdu5Amc4t sWo+oRirEBGcU6tLbtDP6q8gl6Kkc7DSj+tZGQt28WcbaG1F9aiqmjJda89ja+/VcyWc CHeNw5zzLJ6cJYz8rCp91/Cd/Q1+ivV+HRlQkS2aIkELIUOLNgIBfs8gf3pfuhaViHGy J2VNbzzx14OstapnM/S4SyK8UbNMjqZBekZI1HsBFTyXEOpobcSJguxKV/qy+sZsmU1O ngug== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=PUG8rTle; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b34si374211plc.583.2017.06.15.09.36.32; Thu, 15 Jun 2017 09:36:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=PUG8rTle; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752582AbdFOQdZ (ORCPT + 10 others); Thu, 15 Jun 2017 12:33:25 -0400 Received: from mail-wr0-f177.google.com ([209.85.128.177]:35894 "EHLO mail-wr0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752545AbdFOQdP (ORCPT ); Thu, 15 Jun 2017 12:33:15 -0400 Received: by mail-wr0-f177.google.com with SMTP id 36so25248063wry.3 for ; Thu, 15 Jun 2017 09:33:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PTyoPZBrq6iZva4zHnyG6otP9L/TlXnfZ3rg7uBAhNU=; b=PUG8rTleYiRzdBG/zdN8ggQpRVuY2AV/B6Sq/v6INpqobwzlWe7eo7ToVF2/1SuZSY 6IOmYz9mMjxDSmJc+lzb+Ns6BgfI7SNKIn5w80SD2GaGWynVYgP0v6alhOTJfxLGgXQy 04he9GYWBuKRF1Dko+tnhzfzWeOAgT/uc6z8U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PTyoPZBrq6iZva4zHnyG6otP9L/TlXnfZ3rg7uBAhNU=; b=shQChR/ge2VuL7Gq7jmeTE24SiZMP+wHdqfHoKRJx+oJsIgPRC1yy90X5LACGnY1Jq WULyfOmBifjbvGJXHWeu2idxVf4tfvj+e/v4GN04yxdxfw3Uy8HrmCKuOQC4ULPSQSph HJEElTyJooj/A1Pjd9ev1h3wQ5jzIPu2zXCpSWSE1HKmaR0zDeUMNK8NhhiikrF/gWg/ OiFBQE6f24Ri1Oc2htJUmBMDPhvFhAlbUx6G9DZuQeXNeYPndTnjRb82VEluWXOXF0+j BH/q9hT9PgdXaAO7idYkRnBAuYPtFGIKmyPVG21pEiMDrfRLom6fDLIH/4/qf7XOPJCG jVXg== X-Gm-Message-State: AKS2vOyv3m5xGbFLVFA7mJEx2avVyQVVvhnS/8X6U216Gw3HOwZ6UqW/ q5rgqkwCHM7k+gCphBfUpQ== X-Received: by 10.223.182.172 with SMTP id j44mr3062810wre.122.1497544388635; Thu, 15 Jun 2017 09:33:08 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id m73sm541890wmi.25.2017.06.15.09.33.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Jun 2017 09:33:08 -0700 (PDT) From: Stanimir Varbanov To: Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Stanimir Varbanov Subject: [PATCH v11 11/19] media: venus: hfi_cmds: fix variable dereferenced before check Date: Thu, 15 Jun 2017 19:31:52 +0300 Message-Id: <1497544320-2269-12-git-send-email-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497544320-2269-1-git-send-email-stanimir.varbanov@linaro.org> References: <1497544320-2269-1-git-send-email-stanimir.varbanov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This fixes a warning found when building the driver with gcc7: drivers/media/platform/qcom/venus/hfi_cmds.c:415 pkt_session_set_property_1x() warn: variable dereferenced before check 'pkt' (see line 412) drivers/media/platform/qcom/venus/hfi_cmds.c:1177 pkt_session_set_property_3xx() warn: variable dereferenced before check 'pkt' (see line 1174) Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/hfi_cmds.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index dad41a6af42e..b83c5b8ddccb 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -409,12 +409,14 @@ static int pkt_session_get_property_1x(struct hfi_session_get_property_pkt *pkt, static int pkt_session_set_property_1x(struct hfi_session_set_property_pkt *pkt, void *cookie, u32 ptype, void *pdata) { - void *prop_data = &pkt->data[1]; + void *prop_data; int ret = 0; if (!pkt || !cookie || !pdata) return -EINVAL; + prop_data = &pkt->data[1]; + pkt->shdr.hdr.size = sizeof(*pkt); pkt->shdr.hdr.pkt_type = HFI_CMD_SESSION_SET_PROPERTY; pkt->shdr.session_id = hash32_ptr(cookie); @@ -1171,12 +1173,14 @@ static int pkt_session_set_property_3xx(struct hfi_session_set_property_pkt *pkt, void *cookie, u32 ptype, void *pdata) { - void *prop_data = &pkt->data[1]; + void *prop_data; int ret = 0; if (!pkt || !cookie || !pdata) return -EINVAL; + prop_data = &pkt->data[1]; + pkt->shdr.hdr.size = sizeof(*pkt); pkt->shdr.hdr.pkt_type = HFI_CMD_SESSION_SET_PROPERTY; pkt->shdr.session_id = hash32_ptr(cookie); From patchwork Thu Jun 15 16:31:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 105665 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp888252qgd; Thu, 15 Jun 2017 09:33:23 -0700 (PDT) X-Received: by 10.98.157.74 with SMTP id i71mr6143384pfd.141.1497544403728; Thu, 15 Jun 2017 09:33:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497544403; cv=none; d=google.com; s=arc-20160816; b=zLozjwVPIZXH16rYUKWJPLCFJlyStuRa04MsFL1Ab0ZUrZhRiTiez72UJ0DyNSejIK GzfbKKwxwMUZ5ZigXy+MPGIr3X2FZj1ARbKAU5HVko7HLuie3M1OJKPtLmI9MCpSbp6Z X773tAg9xUvlfHFnRRUwsbFqSJCj9Hov1uCyg4CoawaWHNDD+lp1acEQdrn8t6W5XyZh FMO4XUMUEh1ORSl61RH+gJx5qalyHjCp5xWReQGzob2GVX3yLOxne8Bbm8uQKn0xl635 JaLfK9p5X5Gc3BHwNUoWsgaRCYA6lswNdd4aAKXHaJmMJcsITuk5VYfej/kAKTcwf1js HkdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=RA20xSdHDcinDahJt53rwwZa03+dDzxTP5bl8gmGb7M=; b=ytZJgqP/Ye+PlRq0NDjCJxiWBNLgADHClDVpUK6N6R5bLjnMUSQWz3E10roRlItVfg goBhZ2gfsl92CJT4ghwfbRpXlbZPLZmhQWy4Ivg2EHb82uTSbvwmYpP4onl36MssSX/i LGNiTcX1pvEuz7468fRD+Nvuhe25MPMVADStjRwmhpa650OCNtW1DN6sv3NCUQK/Qj5H 6icUf4oqwvEGUw4qLWXoVfk/sP+1LRzMAwiIJm5KWr0jfCnnaKxc/mGk4yYt33ghfYGf f3er0DrUoTQI+w2NnExJRbYUTE7NrrF9wrxp5xCnowbzd+Pzi16Sh+qNNRVcf0Vm/jef JQAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=ewNZN80F; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p5si397449pfl.413.2017.06.15.09.33.23; Thu, 15 Jun 2017 09:33:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=ewNZN80F; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752580AbdFOQdT (ORCPT + 10 others); Thu, 15 Jun 2017 12:33:19 -0400 Received: from mail-wr0-f177.google.com ([209.85.128.177]:35099 "EHLO mail-wr0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752396AbdFOQdQ (ORCPT ); Thu, 15 Jun 2017 12:33:16 -0400 Received: by mail-wr0-f177.google.com with SMTP id q97so25309123wrb.2 for ; Thu, 15 Jun 2017 09:33:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UPX0lJQd+UhYy0Nc7V1te/sZx0Dwpc1CEu79iFUN2oU=; b=ewNZN80FYcvfIKJ/49+jbVvBhd5wJoWeXRJd/PDGcOFlM+OrxCytJ/GpYhp/Du8JBW 7RYl+0NmglW0OLUzRwtO34sPMNmR7B7wrFBzbN0tP7K167MNj4TEg2Krvx+7AfcAJZhm NREo//JSu1jC4AiLUnX+UHR36rpzkJVQtyklA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=UPX0lJQd+UhYy0Nc7V1te/sZx0Dwpc1CEu79iFUN2oU=; b=AB5SCjV3WC2G0AToYanXfddf/4B6r5eBDLKS2oOqX3CSzYFwVXUxcId6CAovenYPuO N8AYMhibJ+M0adhqmoUtkikE98zKtMxEhfH9+9os+DNML96ZyBwTJ7AsZrBL5ztBgMu5 AH2X9UQYLocPZJvDkHdx56Gj9QjTuEijWT5Wv4VRx9vLS7d6iPlUe/RO8ofSKFNByQcK PvhkWfzrFC8opCcTMd+/lwHSHWx9EWyKk1wIfZJXtUYnNGEkUHPMoC22YVi6YvBz9LeJ yt01IWahCq1p10BbOwSbmTJmqb9E6GrozYMj7STm/dPmEmWzQJio4hSiIGQUfdxFg0Hu WRcg== X-Gm-Message-State: AKS2vOzXXHgRC4wLGBTy8uxMDpdLlpD+v5T2jp7MkqDNHIwMG6jh6oup RSZ6kLLN8ENh6rZN X-Received: by 10.223.166.248 with SMTP id t111mr4726667wrc.39.1497544390460; Thu, 15 Jun 2017 09:33:10 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id m73sm541890wmi.25.2017.06.15.09.33.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Jun 2017 09:33:10 -0700 (PDT) From: Stanimir Varbanov To: Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Stanimir Varbanov Subject: [PATCH v11 12/19] media: venus: helpers: fix variable dereferenced before check Date: Thu, 15 Jun 2017 19:31:53 +0300 Message-Id: <1497544320-2269-13-git-send-email-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497544320-2269-1-git-send-email-stanimir.varbanov@linaro.org> References: <1497544320-2269-1-git-send-email-stanimir.varbanov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This fixes a warning found when building the driver with gcc7: drivers/media/platform/qcom/venus/helpers.c:157 load_per_instance() warn: variable dereferenced before check 'inst' (see line 153) Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/helpers.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index f777ef80b941..5f4434c0a8f1 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -150,14 +150,12 @@ static int intbufs_free(struct venus_inst *inst) static u32 load_per_instance(struct venus_inst *inst) { - u32 w = inst->width; - u32 h = inst->height; u32 mbs; if (!inst || !(inst->state >= INST_INIT && inst->state < INST_STOP)) return 0; - mbs = (ALIGN(w, 16) / 16) * (ALIGN(h, 16) / 16); + mbs = (ALIGN(inst->width, 16) / 16) * (ALIGN(inst->height, 16) / 16); return mbs * inst->fps; } From patchwork Thu Jun 15 16:31:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 105666 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp888255qgd; Thu, 15 Jun 2017 09:33:24 -0700 (PDT) X-Received: by 10.98.5.130 with SMTP id 124mr6024045pff.209.1497544404375; Thu, 15 Jun 2017 09:33:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497544404; cv=none; d=google.com; s=arc-20160816; b=e+lQzzx+Gl/A2IZOF212WLjYuxupMDbnWziwxqYgEEkV0cgWLkN4uJ1zVzDkFlGKGq ZRv7wQLGUN/hyuM9R0cH6uutTwq9AlEJ/hg0cxd6W8g5s2QZrQeIwbbtCez45MFqCxTO 0xKxAxHyX1M7Cx4rpInKCSWNF9J4b0EGGPCyzihUFrn/nqwx3nC4X2ztnVvjcS8vG8Bf cybGz6B/ZKA7r3bjSCRndvsQTwFmiJ483FgSMirIJ1FZCsPNt0lp7NqGr+5bu4MMEJfT avnM8AugXjXdqTrR/B4sg7Td2052P4eNCVwB4cwqN+knuyQ/irJNykeh4efTXCvml3oG SJ6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=8htfl3CcJ3YWD/QYw4Fko1jWLy+GNotLu0EgG2OZd/E=; b=YHbyg/5dU0DiXHRh0SwSp8UvvcKsUcnU7zSDANKRfJbWumbL4MO4AInEnaiVPePFIE 1fLHjAghObshdhjpUsxgvLWsRAZ/iPaiPA311HiSZKCUl/Xk9UD5J6VPixLZoAO0zkQk es5B1j5nYQZXk9ojdizh/Rgtei60TnUG5beqon/9DM9YTlBvYdDUlOAQguUT6/wP+01x QxwYST6CdepO4cMdH6jgQeO7S0WpFvSiMx+3T7mE/iR8racYlJ17DaucCHgrrW48BqOr TiGTs88JS6GcMsMCNt2e1/m8O8tFr3JYvjBjbLaIEF0xQmFNz4Cvh9fzK+7VdErKsWQC KR1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=FKWjbfZh; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p5si397449pfl.413.2017.06.15.09.33.24; Thu, 15 Jun 2017 09:33:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=FKWjbfZh; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752577AbdFOQdS (ORCPT + 10 others); Thu, 15 Jun 2017 12:33:18 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:34883 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752440AbdFOQdR (ORCPT ); Thu, 15 Jun 2017 12:33:17 -0400 Received: by mail-wm0-f48.google.com with SMTP id x70so4454837wme.0 for ; Thu, 15 Jun 2017 09:33:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LddNM0B7BF2Q1NR9owPFwmfghKr/CobKCgYvCgn0VcA=; b=FKWjbfZhz+ibSuga+28GvIX7NpiZt8TqK6phg/87VxeiGT7R0rQRDJq7rNgDFvGZHc dm/J3ZXBek67r+wlz+UO6c1TbcGKIoudNDw2DaJ7h+MIQBMbny4gWjVSH+ebeQwgWJK7 s/9ABWAkmrIQzxIhMnoTRM7rhriY7q+1QkOUg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LddNM0B7BF2Q1NR9owPFwmfghKr/CobKCgYvCgn0VcA=; b=JP5qCBKXksRP2fmktG/ZG2Kpqrn8k+AQLGQD+OwuEv4xjqwR6HtnDEF1U2FaUS6Zr9 outbfMH1BaGc70iNg2U81KSD+W2dJNnBLVihtgcIQ4ilwHioPueAxo6570k5fSC/wdQ0 J/y7nFKlx+PtN9Jo2tt874pmhWP9kR0pz1lnvdMARCxSsLC7g5z2MH9d2Q5fLYv9mYae xpto6SnrBOLSJRTUJdr6BJqHvrIT+UaQYQOfgCmHUvAcXOTl6LE8mtDNVPI7og8bduBk MBt9bEcqO8w1fMOv278GpTPbbJrVzBcoH1jZ7+r8wuNZ+pjDcV3AtbRzRVvXVRcWVNzG hZFg== X-Gm-Message-State: AKS2vOwyqHXLcSk9V3kJcRXd4bcVzZjg4Aqq7v4BzGnHv06OcKGTeGBf gwpGYwT6yKToFB0C X-Received: by 10.28.66.86 with SMTP id p83mr4361511wma.31.1497544396183; Thu, 15 Jun 2017 09:33:16 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id m73sm541890wmi.25.2017.06.15.09.33.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Jun 2017 09:33:15 -0700 (PDT) From: Stanimir Varbanov To: Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Stanimir Varbanov Subject: [PATCH v11 15/19] media: venus: vdec: fix compile error in vdec_close Date: Thu, 15 Jun 2017 19:31:56 +0300 Message-Id: <1497544320-2269-16-git-send-email-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497544320-2269-1-git-send-email-stanimir.varbanov@linaro.org> References: <1497544320-2269-1-git-send-email-stanimir.varbanov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This fixes the following compile error ocured when building with gcc7: drivers/media/platform/qcom/venus/vdec.c:1022 vdec_close() error: dereferencing freed memory 'inst' by moving kfree as a last call. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/vdec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 96e7e7e71e5f..594315b55b1f 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -1017,9 +1017,10 @@ static int vdec_close(struct file *file) mutex_destroy(&inst->lock); v4l2_fh_del(&inst->fh); v4l2_fh_exit(&inst->fh); - kfree(inst); pm_runtime_put_sync(inst->core->dev_dec); + + kfree(inst); return 0; }