Subject: Re: [PATCH] rionet: Fix refcounting bugs

From: Jakub Kicinski <[email-masked]>
Date: Tue, 28 Mar 2023 19:10:51 -0700

On Tue, 28 Mar 2023 12:50:06 +0800 Liang He wrote:
> In rionet_start_xmit(), we should put the refcount_inc()
> before we add *skb* into the queue, otherwise it may cause
> the consumer to prematurely call refcount_dec().

Are you sure the race can happen? Look around the code, please.

> Besides, before the next rionet_queue_tx_msg() when we
> meet the 'RIONET_MAC_MATCH', we should also call
> refcount_inc() before the skb is added into the queue.

And why is that?

As far as I can tell your patch reorders something that doesn't matter
and then adds a bug :|