Re: [PATCH net] octeontx2-af: fix ng_rvu leak on repeated mailbox init

Ratheesh Kannoth <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.network
Message-ID <aogkK5l55nvAEN2-@rkannoth-OptiPlex-7090>
On 2026-08-20 at 11:06:56, Ratheesh Kannoth ([email protected]) wrote:
> From: Sai Krishna <[email protected]>
>
> rvu_mbox_init() allocates an ng_rvu object on every call and assigns
> it to rvu->ng_rvu. The function is invoked separately for AF-PF
> mailboxes during probe and for AF-VF mailboxes when SR-IOV is enabled,
> so the first allocation is leaked when the second call overwrites the
> pointer.
>
> Allocate ng_rvu only once and reuse it across subsequent mailbox init
> paths.
>
> Fixes: e53ee4acb220 ("octeontx2-af: CN20k basic mbox operations and structures")
> Signed-off-by: Sai Krishna <[email protected]>
> Signed-off-by: Ratheesh Kannoth <[email protected]>

Will address sashiko comments in v2.

pw-bot: changes-requested
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.