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

AngeloGioacchino Del Regno angelogioacchino.delregno at collabora.com
Mon Jan 24 01:26:18 PST 2022


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 at kernel.org>
> Acked-by: Chunfeng Yun <chunfeng.yun at mediatek.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>




More information about the Linux-mediatek mailing list