Skip to content

Commit eac67d8

Browse files
committed
wwan: iosm: use a flexible array rather than allocate short objects
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 29849a4 commit eac67d8

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/net/wwan/iosm/iosm_ipc_coredump.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
/* Max buffer allocated to receive coredump data */
1515
#define MAX_DATA_SIZE 0x00010000
1616

17-
/* Max number of file entries */
18-
#define MAX_NOF_ENTRY 256
19-
2017
/* Max length */
2118
#define MAX_SIZE_LEN 32
2219

@@ -38,7 +35,7 @@ struct iosm_cd_list_entry {
3835
*/
3936
struct iosm_cd_list {
4037
__le32 num_entries;
41-
struct iosm_cd_list_entry entry[MAX_NOF_ENTRY];
38+
struct iosm_cd_list_entry entry[];
4239
} __packed;
4340

4441
/**

0 commit comments

Comments
 (0)