summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-05-20 08:00:13 +0200
committerJakub Kicinski <kuba@kernel.org>2022-05-21 02:56:50 +0200
commiteac67d83bf2553f98cfddd42cfbcfd6f9ccfc287 (patch)
tree221d23653a39be1e2f3862ce9bb390eefbde206f
parentstcp: Use memset_after() to zero sctp_stream_out_ext (diff)
downloadlinux-eac67d83bf2553f98cfddd42cfbcfd6f9ccfc287.tar.xz
linux-eac67d83bf2553f98cfddd42cfbcfd6f9ccfc287.zip
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 <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>
Diffstat (limited to '')
-rw-r--r--drivers/net/wwan/iosm/iosm_ipc_coredump.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/wwan/iosm/iosm_ipc_coredump.h b/drivers/net/wwan/iosm/iosm_ipc_coredump.h
index 0809ba664276..3da5ec75e0f0 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_coredump.h
+++ b/drivers/net/wwan/iosm/iosm_ipc_coredump.h
@@ -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
@@ -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;
/**