diff mbox series

[v2] RDMA/cma: add missed unregister_pernet_subsys in init failure

Message ID 20191206012426.12744-1-hslester96@gmail.com (mailing list archive)
State Mainlined
Commit 44a7b6759000ac51b92715579a7bba9e3f9245c2
Headers show
Series [v2] RDMA/cma: add missed unregister_pernet_subsys in init failure | expand

Commit Message

Chuhong Yuan Dec. 6, 2019, 1:24 a.m. UTC
The driver forgets to call unregister_pernet_subsys() in the error path
of cma_init().
Add the missed call to fix it.

Fixes: 4be74b42a6d0 ("IB/cma: Separate port allocation to network namespaces")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
Changes in v2:
  - Add fixes tag.

 drivers/infiniband/core/cma.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Parav Pandit Dec. 6, 2019, 4:32 a.m. UTC | #1
On 12/5/2019 7:24 PM, Chuhong Yuan wrote:
> The driver forgets to call unregister_pernet_subsys() in the error path
> of cma_init().
> Add the missed call to fix it.
> 
> Fixes: 4be74b42a6d0 ("IB/cma: Separate port allocation to network namespaces")
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
> Changes in v2:
>   - Add fixes tag.
> 
>  drivers/infiniband/core/cma.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
> index 25f2b70fd8ef..43a6f07e0afe 100644
> --- a/drivers/infiniband/core/cma.c
> +++ b/drivers/infiniband/core/cma.c
> @@ -4763,6 +4763,7 @@ static int __init cma_init(void)
>  err:
>  	unregister_netdevice_notifier(&cma_nb);
>  	ib_sa_unregister_client(&sa_client);
> +	unregister_pernet_subsys(&cma_pernet_operations);
>  err_wq:
>  	destroy_workqueue(cma_wq);
>  	return ret;
> 
Reviewed-by: Parav Pandit <parav@mellanox.com>
Doug Ledford Dec. 9, 2019, 5:08 p.m. UTC | #2
On Fri, 2019-12-06 at 04:32 +0000, Parav Pandit wrote:
> On 12/5/2019 7:24 PM, Chuhong Yuan wrote:
> > The driver forgets to call unregister_pernet_subsys() in the error
> > path
> > of cma_init().
> > Add the missed call to fix it.
> > 
> > Fixes: 4be74b42a6d0 ("IB/cma: Separate port allocation to network
> > namespaces")
> > Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> > ---
> > Changes in v2:
> >   - Add fixes tag.
> > 
> >  drivers/infiniband/core/cma.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/infiniband/core/cma.c
> > b/drivers/infiniband/core/cma.c
> > index 25f2b70fd8ef..43a6f07e0afe 100644
> > --- a/drivers/infiniband/core/cma.c
> > +++ b/drivers/infiniband/core/cma.c
> > @@ -4763,6 +4763,7 @@ static int __init cma_init(void)
> >  err:
> >  	unregister_netdevice_notifier(&cma_nb);
> >  	ib_sa_unregister_client(&sa_client);
> > +	unregister_pernet_subsys(&cma_pernet_operations);
> >  err_wq:
> >  	destroy_workqueue(cma_wq);
> >  	return ret;
> > 
> Reviewed-by: Parav Pandit <parav@mellanox.com>

Thanks, applied to for-rc.
diff mbox series

Patch

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 25f2b70fd8ef..43a6f07e0afe 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -4763,6 +4763,7 @@  static int __init cma_init(void)
 err:
 	unregister_netdevice_notifier(&cma_nb);
 	ib_sa_unregister_client(&sa_client);
+	unregister_pernet_subsys(&cma_pernet_operations);
 err_wq:
 	destroy_workqueue(cma_wq);
 	return ret;