Re: [PATCH] axis-fifo: use size_t for write size calculations
From: Dan Carpenter
Date: Fri Jul 31 2026 - 07:10:51 EST
On Fri, Jul 31, 2026 at 12:43:07AM -0300, Lucas Jeffrey wrote:
> The write length is provided as size_t, but words_to_write and the
> return value storage used narrower types. Use size_t for the word count
> and ssize_t for the return value to keep the types consistent with the
> write interface.
>
> This avoids relying on implicit size limits when handling write sizes.
>
> Signed-off-by: Lucas Jeffrey <luquijeffrey@xxxxxxxxx>
> ---
This doesn't affect real life because len is capped in rw_verify_area().
The commit message needs to make it clear that this is just a clean up
and not a fix. If we pretended that the len value in read/write
functions was an range from 0-ULONG_MAX then we would have a ton of
integer overflow bugs etc.
regards,
dan carpenter