Skip to content
Commit 3354b54f authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

media: vivid: shut up warnings due to a non-trivial logic



The vivid driver uses a complex logic to save one kalloc/kfree
allocation. That non-trivial way of allocating data causes
smatch to warn:
	drivers/media/platform/vivid/vivid-core.c:869 vivid_create_instance() warn: potentially one past the end of array 'dev->query_dv_timings_qmenu[dev->query_dv_timings_size]'
	drivers/media/platform/vivid/vivid-core.c:869 vivid_create_instance() warn: potentially one past the end of array 'dev->query_dv_timings_qmenu[dev->query_dv_timings_size]'

I also needed to read the code several times in order to understand
what it was desired there. It turns that the logic was right,
although confusing to read.

As it is doing allocations on a non-standard way, let's add some
documentation while shutting up the false positive.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 845b978a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment