RE: [EXT] Re: [PATCH net-next v2 1/4] octeon_ep: add PF-VF mailbox communication

From: Shinas Rasheed
Date: Mon Dec 11 2023 - 01:32:34 EST


Hi Simon,

> > + err = octep_setup_pfvf_mbox(octep_dev);
> > + if (err) {
> > + dev_err(&pdev->dev, " pfvf mailbox setup failed\n");
> > + octep_ctrl_net_uninit(octep_dev);
> > + return err;
>
> Hi Shinas,
>
> This seems inconsistent with other error handling in this function, I
> suspect it is leaking resources. And even if it does not, it's likely to
> lead to such problems as this function is updated in future. Please
> consider consistently handling error unwinding using goto labels in this
> function.
>
> I think that means either making sure that octep_delete_pfvf_mbox() can
> handle the case whereby octep_setup_pfvf_mbox() fails. Or including) the
> steps taken by octep_device_cleanup() in the unwind ladder provided by
> goto
> labels (which could be a separate patch, and I suspect to be the best
> approach). But I could well be wrong.

You are correct. I'll update this in the next version. Thanks for reviewing!

Shinas