]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
[media] media: venus: hfi_venus: fix variable dereferenced before check
authorStanimir Varbanov <stanimir.varbanov@linaro.org>
Thu, 15 Jun 2017 16:31:54 +0000 (13:31 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 20 Jun 2017 11:53:40 +0000 (08:53 -0300)
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 <stanimir.varbanov@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/qcom/venus/hfi_venus.c

index ab209f3d9498b9af2eca926ce16eddffec61d3fa..1caae8feaa36bb192daa31009d5306d40dc75f1f 100644 (file)
@@ -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) {