Skip to content

Commit

Permalink
RDMA/ocrdma: Unregister inet notifier when unloading ocrdma
Browse files Browse the repository at this point in the history
Unregister the inet notifier during ocrdma unload to avoid a panic after
driver unload.

Signed-off-by: Selvin Xavier <selvin.xavier@emulex.com>
Signed-off-by: Devesh Sharma <devesh.sharma@emulex.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
  • Loading branch information
Selvin Xavier authored and Roland Dreier committed Apr 3, 2014
1 parent 7a1e89d commit 2d8f57d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions drivers/infiniband/hw/ocrdma/ocrdma_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,11 @@ static void ocrdma_unregister_inet6addr_notifier(void)
#endif
}

static void ocrdma_unregister_inetaddr_notifier(void)
{
unregister_inetaddr_notifier(&ocrdma_inetaddr_notifier);
}

static int __init ocrdma_init_module(void)
{
int status;
Expand All @@ -552,20 +557,27 @@ static int __init ocrdma_init_module(void)
#if IS_ENABLED(CONFIG_IPV6)
status = register_inet6addr_notifier(&ocrdma_inet6addr_notifier);
if (status)
return status;
goto err_notifier6;
#endif

status = be_roce_register_driver(&ocrdma_drv);
if (status)
ocrdma_unregister_inet6addr_notifier();
goto err_be_reg;

return 0;

err_be_reg:
ocrdma_unregister_inet6addr_notifier();
err_notifier6:
ocrdma_unregister_inetaddr_notifier();
return status;
}

static void __exit ocrdma_exit_module(void)
{
be_roce_unregister_driver(&ocrdma_drv);
ocrdma_unregister_inet6addr_notifier();
ocrdma_unregister_inetaddr_notifier();
ocrdma_rem_debugfs();
}

Expand Down

0 comments on commit 2d8f57d

Please sign in to comment.