From patchwork Mon Jun 12 16:27:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 9782107 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 508BF60352 for ; Mon, 12 Jun 2017 16:32:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44ACB28178 for ; Mon, 12 Jun 2017 16:32:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39B9128405; Mon, 12 Jun 2017 16:32:06 +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 E6C1228178 for ; Mon, 12 Jun 2017 16:32:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754837AbdFLQcD (ORCPT ); Mon, 12 Jun 2017 12:32:03 -0400 Received: from mail-wr0-f169.google.com ([209.85.128.169]:33930 "EHLO mail-wr0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754409AbdFLQaB (ORCPT ); Mon, 12 Jun 2017 12:30:01 -0400 Received: by mail-wr0-f169.google.com with SMTP id g76so101843906wrd.1 for ; Mon, 12 Jun 2017 09:30:00 -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=aC8f7nvzGgOT5IwzN6wNYoUPX8C2N3SeXIBD9EyTKdSs6CfQLnWyJrqFp5X9OcjVFQ v3HAyKIAifEze5JOGm+djbQR32/CkspKVTXlXzQ/PUdyo8hY8LUQhXits55B8Iupscmb AHulCpw4VqwGCqjsD3O42mBpmwpq1+ttHQMTc= 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=AQFOMvy2nXSEXm5kMTzGoxCkxU22/HaLndbF5aJ0GiDbawqHDZV/FW1u7YXTgAFTW+ 4AmwtocLX6uE3OIdF2z9wmdzPEX4NY03ydbYpWlBxXLV6k6LBE6R/BqAG7ZVpfZeMfGN /UBezZNa3g0yRjckVQzX05aeBZyBZNLpZ67reniRiKZtk7Mpx+nBYZgTererOnPHmxWU dkU1ng4eqUCOC4pfWPI0FkIHavfw9j1S0AlF+kpF+8kcAKpvArmepmXnIDYlqWTXyKx3 s4cLs4QIVuYmvQmZLbrGgopXaVZCISIMSJPvKFUqvusV+mMY/vPvhmBvex2F8vdSBwze sQ6w== X-Gm-Message-State: AODbwcCvooIEXEbQ+vJ+oo7wHxYU2JwW+GLlUIeI5cvU+AsjrOTf5IlS oUaBmd10StWgoMmO X-Received: by 10.223.144.134 with SMTP id i6mr8783624wri.92.1497284993540; Mon, 12 Jun 2017 09:29:53 -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.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Jun 2017 09:29:52 -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 13/18] media: venus: hfi_venus: fix variable dereferenced before check Date: Mon, 12 Jun 2017 19:27:50 +0300 Message-Id: <1497284875-19999-14-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 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) {