Commit ded71626 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

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: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent bf78f23a
...@@ -569,7 +569,7 @@ struct hfi_capability { ...@@ -569,7 +569,7 @@ struct hfi_capability {
struct hfi_capabilities { struct hfi_capabilities {
u32 num_capabilities; u32 num_capabilities;
struct hfi_capability data[1]; struct hfi_capability *data;
}; };
#define HFI_DEBUG_MSG_LOW 0x01 #define HFI_DEBUG_MSG_LOW 0x01
...@@ -726,7 +726,7 @@ struct hfi_profile_level { ...@@ -726,7 +726,7 @@ struct hfi_profile_level {
struct hfi_profile_level_supported { struct hfi_profile_level_supported {
u32 profile_count; u32 profile_count;
struct hfi_profile_level profile_level[1]; struct hfi_profile_level *profile_level;
}; };
struct hfi_quality_vs_speed { struct hfi_quality_vs_speed {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment