Re: [PATCH][next] usb: xhci-mtk: Use struct_size() helper in create_sch_ep()

From: AngeloGioacchino Del Regno
Date: Mon Jan 24 2022 - 04:26:32 EST


Il 20/01/22 02:55, Gustavo A. R. Silva ha scritto:
Make use of the struct_size() helper instead of an open-coded version,
in order to avoid any potential type mistakes or integer overflows that,
in the worst scenario, could lead to heap overflows.

Also, address the following sparse warnings:
drivers/usb/host/xhci-mtk-sch.c:265:20: warning: using sizeof on a flexible structure

Link: https://github.com/KSPP/linux/issues/160
Link: https://github.com/KSPP/linux/issues/174
Signed-off-by: Gustavo A. R. Silva <gustavoars@xxxxxxxxxx>
Acked-by: Chunfeng Yun <chunfeng.yun@xxxxxxxxxxxx>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>