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: 103660 Delivered-To: patch@linaro.org Received: by 10.182.29.35 with SMTP id g3csp77794obh; Mon, 12 Jun 2017 09:31:44 -0700 (PDT) X-Received: by 10.84.211.7 with SMTP id b7mr28123154pli.124.1497285104518; Mon, 12 Jun 2017 09:31:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497285104; cv=none; d=google.com; s=arc-20160816; b=cFwAiboK6jnYIswfR33imoe8LERXB1Ln5cU1fyF5WDd5aKxheiC3YYOOWL4AhCYLJ+ PDpi7RX9KCcWVT3/cXaLJ8CqkBbORThTYnQhlNj1yy2okoM9oSGLcX8GzSjwFM3T52RQ c1HGllCG3yj/Ld4IrXfSRTdG0U+umu7K/uIYEHLDIrXz+GoND7ZzFRjjJdIIz3GrTeMi YdDV2gd3Z5LNgizLduD8bRrx/s7LEZwyExgkTMm1i9gqCqvBF4VL3j29VR4InUp5RkL1 PO6zW0qIAuzBsdAk1fmEgmp9rtr4iOKYLgOlCssAaoHBGBY8wGI83imvoE3XBXmvWkw6 8Kfg== 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=pKIZRtc3s+2DL1gVQ1Whem+X1bWUUlYwVVhs7IObsYRRCRladMN5rmkw+mln5QiH5g BDMt6XYNLSG/q6i4IqE0lTeYpBpT8uiB9mi69GSma7k0byBpMo3ljODW7OhY0IJORQE/ 0XUcAQoU8qMHt+NNHQieTyZMUtDPTrKNGf2j8SI5O0ecmtUWhZkDhdEiyjO8uIcFmZoz bfVL+BgN/38GgK11TTnSQYjb0RZU8jLwylgLF3SRCR1nS0YrfIL08jFgUpzGpwGNJHT1 /vTYGgTCv6iDWHmm4xbZgfUd2z9NSkGTVIR4R0OQ2zP/8TBPmGuiTPLNwzbiGICisKwT fwEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; 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 r90si7259987pfe.5.2017.06.12.09.31.44; Mon, 12 Jun 2017 09:31:44 -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; 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 S1754130AbdFLQbb (ORCPT + 4 others); 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 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; }