Re: [PATCH 02/12] net: hns3: Destroy a mutex after initialisation failure in hclge_init_ad_dev()
From: Markus Elfring
Date: Thu May 28 2020 - 14:42:53 EST
> Add a mutex destroy call in hclge_init_ae_dev() when fails.
How do you think about a wording variant like the following?
Change description:
The function âmutex_initâ was called before a call of
the function âhclge_pci_initâ.
But the function âmutex_destroyâ was not called after initialisation
steps failed.
Thus add the missed function call for the completion of
the exception handling.
Would you like to add the tag âFixesâ to the commit message?
â
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> @@ -10108,6 +10108,7 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
> pci_release_regions(pdev);
> pci_disable_device(pdev);
> out:
> + mutex_destroy(&hdev->vport_lock);
> return ret;
> }
How do you think about to use the label âdestroy_mutexâ instead?
Regards,
Markus