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

From: Miquel Raynal <[email-masked]>
Date: Mon, 18 May 2026 13:56:33 +0200

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: [email-masked]

[...]

> -	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