Re: [PATCH v2] staging: rtl8192u: ieee80211_rx: free rxb on reorder alloc failure

From: Greg KH

Date: Fri Feb 13 2026 - 02:29:23 EST


On Thu, Feb 12, 2026 at 06:29:31PM -0500, Yuho Choi wrote:
> RxReorderIndicatePacket() allocates prxbIndicateArray with kmalloc_array().
> If the allocation fails, the function returns without freeing the incoming
> prxb and its subframes.
>
> With JOHN_NOCPY enabled, this leaks the original skb as well because skb
> ownership is transferred to rxb->subframes[] and ieee80211_rx() does not
> free skb in that configuration.
>
> Free all prxb->subframes[] and prxb before returning on the allocation
> failure path.
>
> Signed-off-by: Yuho Choi <yqc5929@xxxxxxx>
> ---
> drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
> index b58e75932ecd..942ded5a3bae 100644
> --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
> +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
> @@ -598,8 +598,14 @@ static void RxReorderIndicatePacket(struct ieee80211_device *ieee,
> prxbIndicateArray = kmalloc_array(REORDER_WIN_SIZE,
> sizeof(struct ieee80211_rxb *),
> GFP_ATOMIC);
> - if (!prxbIndicateArray)
> + if (!prxbIndicateArray) {
> + int i;
> +
> + for (i = 0; i < prxb->nr_subframes; i++)
> + dev_kfree_skb(prxb->subframes[i]);
> + kfree(prxb);
> return;
> + }
>
> /* Rx Reorder initialize condition.*/
> if (pTS->rx_indicate_seq == 0xffff)
> --
> 2.43.0
>

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- This looks like a new version of a previously submitted patch, but you
did not list below the --- line any changes from the previous version.
Please read the section entitled "The canonical patch format" in the
kernel file, Documentation/process/submitting-patches.rst for what
needs to be done here to properly describe this.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot