Subject: Re: [PATCH net-next] wwan: iosm: use a flexible array rather than allocate short objects

From: Jakub Kicinski <[email-masked]>
Date: Thu, 19 May 2022 23:03:53 -0700

On Thu, 19 May 2022 23:00:13 -0700 Jakub Kicinski wrote:
> 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 <[email-masked]>

Coincidentally IDK if this:

int ipc_coredump_get_list(struct iosm_devlink *devlink, u16 cmd)

	if (byte_read != MAX_CD_LIST_SIZE)
		goto cd_init_fail;

shouldn't set ret before jumping? Maybe set it to 0 if it's okay for 
it to be zero to make that clear?