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

From: Ratheesh Kannoth

Date: Fri Aug 21 2026 - 06:11:50 EST


On 2026-08-20 at 11:06:56, Ratheesh Kannoth (rkannoth@xxxxxxxxxxx) wrote:
> From: Sai Krishna <saikrishnag@xxxxxxxxxxx>
>
> 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 <saikrishnag@xxxxxxxxxxx>
> Signed-off-by: Ratheesh Kannoth <rkannoth@xxxxxxxxxxx>

Will address sashiko comments in v2.

pw-bot: changes-requested