From: Amir Vadai <amirv@mellanox.com>
To: Wei Yang <weiyang@linux.vnet.ibm.com>, <davem@davemloft.net>,
<jackm@dev.mellanox.co.il>, <netdev@vger.kernel.org>
Subject: Re: [PATCH] net/mlx4_core: destroy workqueue when driver fails to register
Date: Mon, 2 Dec 2013 10:12:46 +0200 [thread overview]
Message-ID: <529C40FE.8040908@mellanox.com> (raw)
In-Reply-To: <1385948684-7284-1-git-send-email-weiyang@linux.vnet.ibm.com>
On 02/12/2013 03:44, Wei Yang wrote:
> When driver registration fails, we need to clean up the resources allocated
> before. mlx4_core missed to destroy the workqueue allocated.
>
> This patch destroies the workqueue when registration fails.
>
> Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
> ---
> drivers/net/ethernet/mellanox/mlx4/main.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
> index 5789ea2..01fc651 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/main.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/main.c
> @@ -2635,6 +2635,8 @@ static int __init mlx4_init(void)
> return -ENOMEM;
>
> ret = pci_register_driver(&mlx4_driver);
> + if (ret < 0)
> + destroy_workqueue(mlx4_wq);
> return ret < 0 ? ret : 0;
> }
>
>
Acked-By: Amir Vadai <amirv@mellanox.com>
next prev parent reply other threads:[~2013-12-02 8:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-02 1:44 [PATCH] net/mlx4_core: destroy workqueue when driver fails to register Wei Yang
2013-12-02 8:12 ` Amir Vadai [this message]
2013-12-02 20:11 ` Or Gerlitz
2013-12-03 1:36 ` Wei Yang
-- strict thread matches above, loose matches on Subject: below --
2013-12-03 2:04 Wei Yang
2013-12-03 16:56 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=529C40FE.8040908@mellanox.com \
--to=amirv@mellanox.com \
--cc=davem@davemloft.net \
--cc=jackm@dev.mellanox.co.il \
--cc=netdev@vger.kernel.org \
--cc=weiyang@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).