Re: [PATCH] selftests: i915: Use struct_size() helper in kmalloc()
From: Andi Shyti
Date: Mon Feb 10 2025 - 12:09:35 EST
Hi luoqing,
On Sat, Feb 08, 2025 at 09:35:39AM +0800, l1138897701@xxxxxxx wrote:
> From: luoqing <luoqing@xxxxxxxxxx>
>
> 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.
>
> Signed-off-by: luoqing <luoqing@xxxxxxxxxx>
Reviewed-by: Andi Shyti <andi.shyti@xxxxxxxxxxxxxxx>
Thanks,
Andi