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: 9789139 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E643860384 for ; Thu, 15 Jun 2017 16:33:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D90C4286BE for ; Thu, 15 Jun 2017 16:33:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE1C6286C0; Thu, 15 Jun 2017 16:33:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7913E286BE for ; Thu, 15 Jun 2017 16:33:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752583AbdFOQdV (ORCPT ); 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 X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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; }