Fix the following smatch warning: hfi_venus.c:1100 venus_isr() warn: variable dereferenced before check 'hdev' (see line 1097) Signed-off-by: Stanimir Varbanov <stanimir.varbanov@xxxxxxxxxx> --- drivers/media/platform/qcom/venus/hfi_venus.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index cebb20cf371f..114fcb6ee9a0 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1093,13 +1093,16 @@ static irqreturn_t venus_isr_thread(struct venus_core *core) static irqreturn_t venus_isr(struct venus_core *core) { struct venus_hfi_device *hdev = to_hfi_priv(core); + void __iomem *cpu_cs_base; + void __iomem *wrapper_base; u32 status; - void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; - void __iomem *wrapper_base = hdev->core->wrapper_base; if (!hdev) return IRQ_NONE; + cpu_cs_base = hdev->core->cpu_cs_base; + wrapper_base = hdev->core->wrapper_base; + status = readl(wrapper_base + WRAPPER_INTR_STATUS); if (IS_V6(core)) { if (status & WRAPPER_INTR_STATUS_A2H_MASK || -- 2.25.1