[PATCH V2] wcn36xx: use struct_size over open coded arithmetic
Kalle Valo
kvalo at kernel.org
Mon Feb 14 09:51:03 PST 2022
cgel.zte at gmail.com wrote:
> Replace zero-length array with flexible-array member and make use
> of the struct_size() helper in kmalloc(). For example:
>
> struct wcn36xx_hal_ind_msg {
> struct list_head list;
> size_t msg_len;
> u8 msg[];
> };
>
> Make use of the struct_size() helper instead of an open-coded version
> in order to avoid any potential type mistakes.
>
> Reported-by: Zeal Robot <zealci at zte.com.cn>
> Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao at zte.com.cn>
> Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>
Patch applied to ath-next branch of ath.git, thanks.
be24835f8323 wcn36xx: use struct_size over open coded arithmetic
--
https://patchwork.kernel.org/project/linux-wireless/patch/20220208015606.1514022-1-chi.minghao@zte.com.cn/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
More information about the wcn36xx
mailing list