Re: [PATCH wpan] ieee802154: ca8210: fix pointer truncation in kfifo on 64-bit

From: Miquel Raynal

Date: Mon May 18 2026 - 08:02:53 EST


Hi Shitalkumar,

Thanks for the patch!

[...]

> Found via a custom Coccinelle semantic patch hunting for short-byte
> kfifo I/O on byte-mode kfifos used to shuttle pointers.
>
> Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device
> driver")

I don't remember what the net rules are exactly, but this definitely
should be backported:

Cc: stable@xxxxxxxxxxxxxxx

[...]

> - if (kfifo_out(&priv->test.up_fifo, &fifo_buffer, 4) != 4) {
> + if (kfifo_out(&priv->test.up_fifo, &fifo_buffer, sizeof(fifo_buffer))
> + != sizeof(fifo_buffer)) {

This line becomes unreadable. Can you please use an intermediate
variable? Something like:

ret = kfifo_out(...);
if (ret != sizeof(...)) {

Thanks,
Miquèl