From patchwork Thu Jun 15 16:31:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 105667 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp888257qgd; Thu, 15 Jun 2017 09:33:24 -0700 (PDT) X-Received: by 10.84.216.28 with SMTP id m28mr4044843pli.275.1497544404692; 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=chxVWEj9h+Qosmh8o6vbGI7INhKp+dYFJGVkA+3nCQNfj2y5Y38Dj7al13AWQktWds 8U/RVd5c+Gw8rGLFn2z4csYCFm/cyiIDfxiLK2/5NJ84qHvn3cdth+DpP/vvg4s8p99b HyMJhF3LRxKBmwXWD/K45AjAIOU3or2wpVdVSXGVUD7JzH8IqcspGfnMXGiAYFhC/7O6 lLREhnVQRqCldbcVBViRSnjpDqnCV6wKdtAm0/SoZPQcWyiv+fouF/HT4TlGn3K9STo/ ocdNfO/d47pXItMw1FydPfNY/x8AMOLbQKt0Jqg4Z6Qv/Z2sAubF9FAgYhF1YfZYydBc amDQ== 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=XspoLBAEzHC84AXzEpLzj/YWAKNTHC7Yym2rw+PtP8o=; b=v0FExJhCUuuXRv6g3/yhFrcYvhHAVoJ0rxFSko2MaMv6o2yx/AMHPzo6rWaG+8x82k yyORWEj5JkFVbdHOyOV4faPMuXY2ZXacpTS+rDSc432lOM9iYdf3CvUvEFL0l0S27GdB rk2GjAM3QDfZOI71OSRCEjHGXTDx933ph0f5QCUhs0/8DWi6CuidpajnzYAHDC8h2LNk eWtr4gv9u1n1k/jN0SwJ5qLWCPRELQjp2I4NFEJduWPOW5IlmoaFp+xCOm2ZvBSsbg9u ozvk55+Hto6eYFvOp8+/vmxbpQ3nWvFfGMHw/va/HYLQwZ+Kfjc+rvmWcPwMnBaLTzKQ GDOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=TaKxByKE; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (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-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=TaKxByKE; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752583AbdFOQdV (ORCPT + 4 others); Thu, 15 Jun 2017 12:33:21 -0400 Received: from mail-wr0-f170.google.com ([209.85.128.170]:33635 "EHLO mail-wr0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752440AbdFOQdT (ORCPT ); Thu, 15 Jun 2017 12:33:19 -0400 Received: by mail-wr0-f170.google.com with SMTP id r103so25474943wrb.0 for ; Thu, 15 Jun 2017 09:33:18 -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=XspoLBAEzHC84AXzEpLzj/YWAKNTHC7Yym2rw+PtP8o=; b=TaKxByKE5rvQ/zasZRb6LQA2Zo3Lo458SqcQbdGD79xQoMXDGFE/ia7jsBHDg15gzM 58ZOn/tj9DeNRjaSiXzKoKqnsbsk9Jsut19LbrpuQ7LW5v80KKZVBz1FQsEOfVlMNCZM ImaimqKOl54JSymKRBZkZSFBYL5ZuskZBjPkQ= 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=XspoLBAEzHC84AXzEpLzj/YWAKNTHC7Yym2rw+PtP8o=; b=GJS5BiDPO/FPV5Nw1OxpmQhAyc4ioXNPV0LZLjbCLVG4zOAHxDdXOvV0BjCPRCw2N4 I0yPlCUrYAB7Jzp79IUcGAgJbEgxhFHvPHNdMQrq7l+K0fxKfhgPF3Bu47pDEEIXis7y TYlBM1W82GXjAh4mUESHwby5q+tilCihxihRlJjQrK3UQibEdJGAf2jFyVeJrHtU2bSr Rp5taCZt6agoq41HLL2dxMha8UhNXEIoITVfPbsPRWWjOeyDxFIbdX6EOCwWPwnVTcuT x9t2NxgzNMDWsBuP8GhMH8CJfPMWqGYm3lF2NKSX/SgdJtcFofaXRkuPXLPWn+hNoppi DG3Q== X-Gm-Message-State: AKS2vOw2Rh8eb0NcAOswAaJH4Pqgokc1ny606KufV9ZL1PP5lGORrDLc nm4CBOQc+R0It3M9 X-Received: by 10.223.160.219 with SMTP id n27mr4536001wrn.198.1497544397903; Thu, 15 Jun 2017 09:33:17 -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.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Jun 2017 09:33:17 -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 16/19] media: venus: venc: fix compile error in venc_close Date: Thu, 15 Jun 2017 19:31:57 +0300 Message-Id: <1497544320-2269-17-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-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This fixes the following compile error ocured when building with gcc7: drivers/media/platform/qcom/venus/venc.c:1150 venc_close() error: dereferencing freed memory 'inst' by moving kfree as a last call. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/venc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index d5b4b5bf10a2..39748e7a08e4 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -1145,10 +1145,10 @@ static int venc_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_enc); + kfree(inst); return 0; }