netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] wwan: iosm: use a flexible array rather than allocate short objects
@ 2022-05-20  6:00 Jakub Kicinski
  2022-05-20  6:03 ` Jakub Kicinski
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jakub Kicinski @ 2022-05-20  6:00 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, pabeni, Jakub Kicinski, m.chetan.kumar,
	linuxwwan, loic.poulain, ryazanov.s.a, johannes

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.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: m.chetan.kumar@intel.com
CC: linuxwwan@intel.com
CC: loic.poulain@linaro.org
CC: ryazanov.s.a@gmail.com
CC: johannes@sipsolutions.net
---
 drivers/net/wwan/iosm/iosm_ipc_coredump.h | 5 +----
 1 file changed, 1 insertion(+), 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;
 
 /**
-- 
2.34.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-21  1:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-20  6:00 [PATCH net-next] wwan: iosm: use a flexible array rather than allocate short objects Jakub Kicinski
2022-05-20  6:03 ` Jakub Kicinski
2022-05-20 18:12   ` Kumar, M Chetan
2022-05-20 18:13 ` Kumar, M Chetan
2022-05-21  1:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).