linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 02/12] net: hns3: Destroy a mutex after initialisation failure in hclge_init_ad_dev()
@ 2020-05-28 18:42 Markus Elfring
  2020-05-29  1:56 ` tanhuazhong
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Elfring @ 2020-05-28 18:42 UTC (permalink / raw)
  To: Huazhong Tan, netdev
  Cc: linux-kernel, linuxarm, David S. Miller, Jakub Kicinski,
	Salil Mehta, Yisen Zhuang

> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-29  9:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28 18:42 [PATCH 02/12] net: hns3: Destroy a mutex after initialisation failure in hclge_init_ad_dev() Markus Elfring
2020-05-29  1:56 ` tanhuazhong
2020-05-29  5:04   ` [02/12] net: hns3: Destroy a mutex after initialisation failure in hclge_init_ae_dev() Markus Elfring
2020-05-29  9:00   ` Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).