diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-02-07 18:28:19 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-02-07 18:29:21 +0100 |
commit | 22f05d646df9fdb4f1ff19582f17d350665c2ea9 (patch) | |
tree | 25b4858ebce75a236e4416d936406b83fed87404 /drivers/media | |
parent | media: vivid: add vertical down sampling to imagesize calc (diff) | |
download | linux-22f05d646df9fdb4f1ff19582f17d350665c2ea9.tar.xz linux-22f05d646df9fdb4f1ff19582f17d350665c2ea9.zip |
media: vim2m: don't use curr_ctx->dev before checking
It seems that it is possible that dev to be null, as there's
a warning printing:
"Instance released before the end of transaction"
Solves this warning:
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: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/vim2m.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/platform/vim2m.c b/drivers/media/platform/vim2m.c index bfa1a2a16009..bd125ad34343 100644 --- a/drivers/media/platform/vim2m.c +++ b/drivers/media/platform/vim2m.c @@ -520,13 +520,14 @@ 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); |