drivers/media/platform/vim2m.c: drivers/media/platform/vim2m.c:525 
device_work() warn: variable dereferenced before check 'curr_ctx' (see line 523)

Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>
---
 drivers/media/platform/vim2m.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/vim2m.c b/drivers/media/platform/vim2m.c
index e31c14c7d37f..910727982230 100644
--- a/drivers/media/platform/vim2m.c
+++ b/drivers/media/platform/vim2m.c
@@ -520,13 +520,13 @@ static void device_work(struct work_struct *w)
        unsigned long flags;
 
        curr_ctx = container_of(w, struct vim2m_ctx, work_run.work);
-       vim2m_dev = curr_ctx->dev;
 
        if (NULL == curr_ctx) {
                pr_err("Instance released before the end of transaction\n");
                return;
        }
 
+       vim2m_dev = curr_ctx->dev;
        src_vb = v4l2_m2m_src_buf_remove(curr_ctx->fh.m2m_ctx);
        dst_vb = v4l2_m2m_dst_buf_remove(curr_ctx->fh.m2m_ctx);
 
-- 
2.20.1

Reply via email to