]> git.baikalelectronics.ru Git - kernel.git/commit
media: hfi_parser: don't trick gcc with a wrong expected size
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 25 Mar 2019 21:09:05 +0000 (17:09 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 25 Mar 2019 22:02:34 +0000 (18:02 -0400)
commit412faea5f25709328241670ac777dc2a5c05bca6
treecb593f0a48af126cf67ba2b8ea40c12749ad296e
parentee5f35bd8bcb26d873698b8736dd75d2fdade3f9
media: hfi_parser: don't trick gcc with a wrong expected size

Smatch warns about small size on two structs:

drivers/media/platform/qcom/venus/hfi_parser.c:103 parse_profile_level() error: memcpy() 'proflevel' too small (8 vs 128)
drivers/media/platform/qcom/venus/hfi_parser.c: drivers/media/platform/qcom/venus/hfi_parser.c:129 parse_caps() error: memcpy() 'cap' too small (16 vs 512)

The reason is that the hfi_parser actually expects:
    - multiple data entries on hfi_capabilities
    - multiple profile_level on hfi_profile_level_supported

However, the structs trick gcc, making it to believe that
there's just one value for each.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/qcom/venus/hfi_helper.h