netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cxgb4: remove workqueue when driver registration fails
@ 2013-09-06  1:32 Wei Yang
  2013-09-11 19:52 ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Wei Yang @ 2013-09-06  1:32 UTC (permalink / raw)
  To: dm, netdev; +Cc: davem, Wei Yang

When driver registration fails, we need to clean up the resources allocated
before. cxgb4 missed to destroy the workqueue allocated at the very beginning.

This patch destroies the workqueue when registration fails.

Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 5a3256b..1dde5a3 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -5868,8 +5868,11 @@ static int __init cxgb4_init_module(void)
 		pr_warn("could not create debugfs entry, continuing\n");
 
 	ret = pci_register_driver(&cxgb4_driver);
-	if (ret < 0)
+	if (ret < 0) {
 		debugfs_remove(cxgb4_debugfs_root);
+		destroy_workqueue(workq);
+	}
 	return ret;
 }
 
-- 
1.7.1

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

* Re: [PATCH] cxgb4: remove workqueue when driver registration fails
  2013-09-06  1:32 [PATCH] cxgb4: remove workqueue when driver registration fails Wei Yang
@ 2013-09-11 19:52 ` David Miller
  2013-09-15 12:24   ` Wei Yang
  0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2013-09-11 19:52 UTC (permalink / raw)
  To: weiyang; +Cc: dm, netdev

From: Wei Yang <weiyang@linux.vnet.ibm.com>
Date: Fri,  6 Sep 2013 09:32:25 +0800

> When driver registration fails, we need to clean up the resources allocated
> before. cxgb4 missed to destroy the workqueue allocated at the very beginning.
> 
> This patch destroies the workqueue when registration fails.
> 
> Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>

This patch was corrupted by your email client, please email the patch
to yourself, make sure the patch you receive in the email applies
cleanly to the current 'net' tree, and then resubmit.

Thanks.

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

* Re: [PATCH] cxgb4: remove workqueue when driver registration fails
  2013-09-11 19:52 ` David Miller
@ 2013-09-15 12:24   ` Wei Yang
  0 siblings, 0 replies; 7+ messages in thread
From: Wei Yang @ 2013-09-15 12:24 UTC (permalink / raw)
  To: David Miller; +Cc: weiyang, dm, netdev

On Wed, Sep 11, 2013 at 03:52:00PM -0400, David Miller wrote:
>From: Wei Yang <weiyang@linux.vnet.ibm.com>
>Date: Fri,  6 Sep 2013 09:32:25 +0800
>
>> When driver registration fails, we need to clean up the resources allocated
>> before. cxgb4 missed to destroy the workqueue allocated at the very beginning.
>> 
>> This patch destroies the workqueue when registration fails.
>> 
>> Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
>
>This patch was corrupted by your email client, please email the patch
>to yourself, make sure the patch you receive in the email applies
>cleanly to the current 'net' tree, and then resubmit.

Sorry for this bothering. 

I will re-do it.

Thanks.

>
>Thanks.

-- 
Richard Yang
Help you, Help me

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

* Re: [PATCH] cxgb4: remove workqueue when driver registration fails
  2013-09-16  4:53 ` David Miller
@ 2013-09-16  5:28   ` Wei Yang
  0 siblings, 0 replies; 7+ messages in thread
From: Wei Yang @ 2013-09-16  5:28 UTC (permalink / raw)
  To: David Miller; +Cc: weiyang, dm, netdev

On Mon, Sep 16, 2013 at 12:53:24AM -0400, David Miller wrote:
>From: Wei Yang <weiyang@linux.vnet.ibm.com>
>Date: Sun, 15 Sep 2013 21:53:00 +0800
>
>> When driver registration fails, we need to clean up the resources allocated
>> before. cxgb4 missed to destroy the workqueue allocated at the very beginning.
>> 
>> This patch destroies the workqueue when registration fails.
>> 
>> Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
>
>Applied.

Thanks~

-- 
Richard Yang
Help you, Help me

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

* Re: [PATCH] cxgb4: remove workqueue when driver registration fails
  2013-09-15 13:53 Wei Yang
  2013-09-15 13:58 ` Wei Yang
@ 2013-09-16  4:53 ` David Miller
  2013-09-16  5:28   ` Wei Yang
  1 sibling, 1 reply; 7+ messages in thread
From: David Miller @ 2013-09-16  4:53 UTC (permalink / raw)
  To: weiyang; +Cc: dm, netdev

From: Wei Yang <weiyang@linux.vnet.ibm.com>
Date: Sun, 15 Sep 2013 21:53:00 +0800

> When driver registration fails, we need to clean up the resources allocated
> before. cxgb4 missed to destroy the workqueue allocated at the very beginning.
> 
> This patch destroies the workqueue when registration fails.
> 
> Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>

Applied.

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

* Re: [PATCH] cxgb4: remove workqueue when driver registration fails
  2013-09-15 13:53 Wei Yang
@ 2013-09-15 13:58 ` Wei Yang
  2013-09-16  4:53 ` David Miller
  1 sibling, 0 replies; 7+ messages in thread
From: Wei Yang @ 2013-09-15 13:58 UTC (permalink / raw)
  To: Wei Yang; +Cc: dm, netdev, davem

This time, I cc-ed to myself. And this applies to the latest net tree.

It looks not corrupted to me. Not sure other people can see it clearly? 

On Sun, Sep 15, 2013 at 09:53:00PM +0800, Wei Yang wrote:
>When driver registration fails, we need to clean up the resources allocated
>before. cxgb4 missed to destroy the workqueue allocated at the very beginning.
>
>This patch destroies the workqueue when registration fails.
>
>Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
>---
> drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c |    4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
>diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
>index 0d0665c..c73cabd 100644
>--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
>+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
>@@ -6149,8 +6149,10 @@ static int __init cxgb4_init_module(void)
> 		pr_warn("could not create debugfs entry, continuing\n");
>
> 	ret = pci_register_driver(&cxgb4_driver);
>-	if (ret < 0)
>+	if (ret < 0) {
> 		debugfs_remove(cxgb4_debugfs_root);
>+		destroy_workqueue(workq);
>+	}
>
> 	register_inet6addr_notifier(&cxgb4_inet6addr_notifier);
>
>-- 
>1.7.1
>
>--
>To unsubscribe from this list: send the line "unsubscribe netdev" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Richard Yang
Help you, Help me

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

* [PATCH] cxgb4: remove workqueue when driver registration fails
@ 2013-09-15 13:53 Wei Yang
  2013-09-15 13:58 ` Wei Yang
  2013-09-16  4:53 ` David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Wei Yang @ 2013-09-15 13:53 UTC (permalink / raw)
  To: dm, netdev; +Cc: davem, weiyang

When driver registration fails, we need to clean up the resources allocated
before. cxgb4 missed to destroy the workqueue allocated at the very beginning.

This patch destroies the workqueue when registration fails.

Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 0d0665c..c73cabd 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -6149,8 +6149,10 @@ static int __init cxgb4_init_module(void)
 		pr_warn("could not create debugfs entry, continuing\n");
 
 	ret = pci_register_driver(&cxgb4_driver);
-	if (ret < 0)
+	if (ret < 0) {
 		debugfs_remove(cxgb4_debugfs_root);
+		destroy_workqueue(workq);
+	}
 
 	register_inet6addr_notifier(&cxgb4_inet6addr_notifier);
 
-- 
1.7.1

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

end of thread, other threads:[~2013-09-16  5:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-06  1:32 [PATCH] cxgb4: remove workqueue when driver registration fails Wei Yang
2013-09-11 19:52 ` David Miller
2013-09-15 12:24   ` Wei Yang
2013-09-15 13:53 Wei Yang
2013-09-15 13:58 ` Wei Yang
2013-09-16  4:53 ` David Miller
2013-09-16  5:28   ` Wei Yang

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).