From patchwork Mon Jun 12 16:27: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: 9782095 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 41ED460352 for ; Mon, 12 Jun 2017 16:31:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36B7228178 for ; Mon, 12 Jun 2017 16:31:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B95D28405; Mon, 12 Jun 2017 16:31:39 +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 C3DD628178 for ; Mon, 12 Jun 2017 16:31:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754130AbdFLQbb (ORCPT ); Mon, 12 Jun 2017 12:31:31 -0400 Received: from mail-wr0-f175.google.com ([209.85.128.175]:35921 "EHLO mail-wr0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754884AbdFLQaG (ORCPT ); Mon, 12 Jun 2017 12:30:06 -0400 Received: by mail-wr0-f175.google.com with SMTP id v111so103604652wrc.3 for ; Mon, 12 Jun 2017 09:30:05 -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=Neae1TfgFsW/9mfmyn7SRB6WH3LOTuNYECwvt8NrWLmjBRLmxRZNjoH31CJ9TeKNsm 5odlFe83MomrDweUnzbLX6pz/iQTvHiPopylWTj1Q19eEUuMRcRy/Iw0SX4mZqiEyql2 pUGfkEVfZWEXDAEmspJmdncdxSP6BWvSLZook= 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=V8Tb46pq4F0DLeOwiTKtt0zKCVbimdoh4eqUg3XylOG2ZICLaR/iUEEjxVHpXXBfy5 aYM5eEmRkwfK3t6XH3frhkdsfMiojH4Crm/6LvG4iDnQFg0Tb9Uw4RDOwgOX9HsK/MHc T+RTvG5A6Do+3Lh88AZvyUs8xe5lrxxu76x2fYXAhtgwhJCMahlIdUc1o5B4g3CLMbdQ w94MkSSRo0aTfyfusnIV6YxqnzpB6i6aYgTBfFctvx7Yx54QndEhQHEzfZfiUP2nXSK3 r4UnWnG+uQv437UxLv8spBmyFE3RbL0xiNh93JHz32/5DHMHgTa/lzgh7wf76Aq7/+e+ 6vlA== X-Gm-Message-State: AKS2vOyEvcA2tZbBJjZfKrvFU+xzacoHk+QPhiD+Esiujir7SdMPWSma dhXnOWiOBIg71dRj X-Received: by 10.223.150.139 with SMTP id u11mr8485903wrb.195.1497284999238; Mon, 12 Jun 2017 09:29:59 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id 49sm14493531wrz.8.2017.06.12.09.29.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Jun 2017 09:29:58 -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 v10 16/18] media: venus: venc: fix compile error in venc_close Date: Mon, 12 Jun 2017 19:27:53 +0300 Message-Id: <1497284875-19999-17-git-send-email-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497284875-19999-1-git-send-email-stanimir.varbanov@linaro.org> References: <1497284875-19999-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; }