Skip to content

Commit

Permalink
wwan: iosm: use a flexible array rather than allocate short objects
Browse files Browse the repository at this point in the history
GCC array-bounds warns that ipc_coredump_get_list() under-allocates
the size of struct iosm_cd_table *cd_table.

This is avoidable - we just need a flexible array. Nothing calls
sizeof() on struct iosm_cd_list or anything that contains it.

Reviewed-by: M Chetan Kumar <m.chetan.kumar@intel.com>
Link: https://lore.kernel.org/r/20220520060013.2309497-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed May 21, 2022
1 parent 29849a4 commit eac67d8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/net/wwan/iosm/iosm_ipc_coredump.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
/* Max buffer allocated to receive coredump data */
#define MAX_DATA_SIZE 0x00010000

/* Max number of file entries */
#define MAX_NOF_ENTRY 256

/* Max length */
#define MAX_SIZE_LEN 32

Expand All @@ -38,7 +35,7 @@ struct iosm_cd_list_entry {
*/
struct iosm_cd_list {
__le32 num_entries;
struct iosm_cd_list_entry entry[MAX_NOF_ENTRY];
struct iosm_cd_list_entry entry[];
} __packed;

/**
Expand Down

0 comments on commit eac67d8

Please sign in to comment.