Re: [PATCH] staging: axis-fifo: validate tx_fifo_depth in axis_fifo_parse_dt()
From: Greg KH
Date: Sat Sep 19 2026 - 06:28:56 EST
On Sat, Sep 19, 2026 at 12:05:11PM +0200, User wrote:
> tx_fifo_depth is read from the device tree as an unsigned int and
> later used in axis_fifo_write() as:
>
> words_to_write > (fifo->tx_fifo_depth - 4)
>
> If tx_fifo_depth is <= 4, the unsigned subtraction wraps around to
> a very large value, making the bounds check ineffective. This can
> cause the calling process to block indefinitely waiting for a FIFO
> vacancy that will never be reached.
>
> Add a validation check in axis_fifo_parse_dt() to reject invalid
> values at probe time with a clear error message.
Please tell your LLM script that device tree values are "trusted".
>
> Compile-tested with:
> make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \
> drivers/staging/axis-fifo/axis-fifo.o
>
> Signed-off-by: User <julianpoulainpro@xxxxxxxxx>
Not a valid name, sorry.
And again, don't use LLMs on drivers/staging/ without reading the email
archives first.
thanks,
greg k-h