From patchwork Thu Jun 15 16:31:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 9789199 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 7BA9660384 for ; Thu, 15 Jun 2017 16:37:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EDB0285B3 for ; Thu, 15 Jun 2017 16:37:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 63D15286BB; Thu, 15 Jun 2017 16:37:05 +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=unavailable 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 A3662285B3 for ; Thu, 15 Jun 2017 16:37:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752321AbdFOQhC (ORCPT ); Thu, 15 Jun 2017 12:37:02 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:37031 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752519AbdFOQdN (ORCPT ); Thu, 15 Jun 2017 12:33:13 -0400 Received: by mail-wm0-f51.google.com with SMTP id d73so4073930wma.0 for ; Thu, 15 Jun 2017 09:33:13 -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=rJ57mFkuiS0ZytTOFrfKVE89r/uJoNQNnEvXpV7PPkg=; b=IZ8gTNRDIEw9WloqHFNLpC5DSxfKrK7Ds8auiQOmRL1IYeXwsP4AG0GAyqjszmVNk8 CuQBXb30re4iiD4HqhdsefdaI5aeM9mqZC6SuTh8PPfsuIZYr52ZL+XQoP6lY/PKJ9Hx PvIeOjoBkOxV7fvalow0Egw2sAUo0YX8Q7Yco= 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=rJ57mFkuiS0ZytTOFrfKVE89r/uJoNQNnEvXpV7PPkg=; b=RFwXoiIaylLNfPLMJdhlzEfmZqBNhSQvCztUfXSKCyNFtLZpsvzYUUTT1LdojBb1qx iDHVPZBo0WIT7rN9l47PcveYz06oOrqte9Npq485kuEop5rEI00lRnzK4hLJO7Nx8Srj UQku5ifKsog0Jl4Z6qSVEqcEcd6lwc5gLe7L0wkXn7G51GglLrhmjWvmOfxOjvaVjjlj Wt5QEu9W94tT9zVUwTx8HXlK52c9zL8pH/I537WTzcqmiduxQ72ybJYMhVPldUi+UNF7 wB182v/WRq/QEpCBgXwauRv2joLo78nOg1N55t1f8B3D0QuW3OOsJWiUW4U0LOQDdFHW MiBw== X-Gm-Message-State: AKS2vOxQc0QyYHd4CL0MAsS6dqgv+EpZu2nen/8q+VwyGqE1/kdD6hmw BRr2iVNa7BVg1iLz X-Received: by 10.28.74.218 with SMTP id n87mr4310657wmi.16.1497544392239; Thu, 15 Jun 2017 09:33:12 -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.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Jun 2017 09:33:11 -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 13/19] media: venus: hfi_venus: fix variable dereferenced before check Date: Thu, 15 Jun 2017 19:31:54 +0300 Message-Id: <1497544320-2269-14-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 a warning found when building with gcc7: drivers/media/platform/qcom/venus/hfi_venus.c:998 venus_isr_thread() warn: variable dereferenced before check 'hdev' (see line 994) Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/hfi_venus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index ab209f3d9498..1caae8feaa36 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -991,13 +991,14 @@ static void venus_process_msg_sys_error(struct venus_hfi_device *hdev, static irqreturn_t venus_isr_thread(struct venus_core *core) { struct venus_hfi_device *hdev = to_hfi_priv(core); - const struct venus_resources *res = hdev->core->res; + const struct venus_resources *res; void *pkt; u32 msg_ret; if (!hdev) return IRQ_NONE; + res = hdev->core->res; pkt = hdev->pkt_buf; if (hdev->irq_status & WRAPPER_INTR_STATUS_A2HWD_MASK) {