Re: [PATCH net] net: marvell: prestera: add missing unregister_netdev() in prestera_port_create()

From: Maciej Fijalkowski
Date: Tue Nov 22 2022 - 07:28:08 EST


On Tue, Nov 22, 2022 at 07:10:31PM +0800, Zhang Changzhong wrote:
> If prestera_port_sfp_bind() fails, unregister_netdev() should be called
> in error handling path.
>
> Compile tested only.
>
> Fixes: 52323ef75414 ("net: marvell: prestera: add phylink support")
> Signed-off-by: Zhang Changzhong <zhangchangzhong@xxxxxxxxxx>

Makes sense and fixes commit is correct.
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@xxxxxxxxx>

> ---
> drivers/net/ethernet/marvell/prestera/prestera_main.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/marvell/prestera/prestera_main.c b/drivers/net/ethernet/marvell/prestera/prestera_main.c
> index 24f9d60..47796e4 100644
> --- a/drivers/net/ethernet/marvell/prestera/prestera_main.c
> +++ b/drivers/net/ethernet/marvell/prestera/prestera_main.c
> @@ -746,6 +746,7 @@ static int prestera_port_create(struct prestera_switch *sw, u32 id)
> return 0;
>
> err_sfp_bind:
> + unregister_netdev(dev);
> err_register_netdev:
> prestera_port_list_del(port);
> err_port_init:
> --
> 2.9.5
>