> If some processes in gemini_ethernet_port_probe() fail,
> free_netdev(dev) needs to be called to avoid a memory leak.

Would you like to use an imperative wording for this change description?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=6ba1b005ffc388c2aeaddae20da29e4810dea298#n151


…
> +++ b/drivers/net/ethernet/cortina/gemini.c
> @@ -2501,8 +2513,10 @@  static int gemini_ethernet_port_probe(struct 
> platform_device *pdev)
>                                       IRQF_SHARED,
>                                       port_names[port->id],
>                                       port);
> -     if (ret)
> +     if (ret) {
> +             free_netdev(netdev);
>               return ret;
> +     }
>
>       ret = register_netdev(netdev);
…

I suggest to add a jump target for the desired exception handling
in this function implementation.

        if (ret)
-               return ret;
+               goto free_netdev;

Regards,
Markus

Reply via email to