diff options
author | Selvin Xavier <selvin.xavier@emulex.com> | 2014-03-18 05:24:56 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2014-04-03 11:30:07 -0400 |
commit | 2d8f57d56f5850a75d6225519e77f75ad9949f25 (patch) | |
tree | 02d1a468e68125d921f040339892e9fb95d49939 | |
parent | 7a1e89d8b793feda96754fd3ba5079c4ba3862ee (diff) |
RDMA/ocrdma: Unregister inet notifier when unloading ocrdma
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>
-rw-r--r-- | drivers/infiniband/hw/ocrdma/ocrdma_main.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c index 8bd9db689b2f..7c504e079744 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c | |||
@@ -539,6 +539,11 @@ static void ocrdma_unregister_inet6addr_notifier(void) | |||
539 | #endif | 539 | #endif |
540 | } | 540 | } |
541 | 541 | ||
542 | static void ocrdma_unregister_inetaddr_notifier(void) | ||
543 | { | ||
544 | unregister_inetaddr_notifier(&ocrdma_inetaddr_notifier); | ||
545 | } | ||
546 | |||
542 | static int __init ocrdma_init_module(void) | 547 | static int __init ocrdma_init_module(void) |
543 | { | 548 | { |
544 | int status; | 549 | int status; |
@@ -552,13 +557,19 @@ static int __init ocrdma_init_module(void) | |||
552 | #if IS_ENABLED(CONFIG_IPV6) | 557 | #if IS_ENABLED(CONFIG_IPV6) |
553 | status = register_inet6addr_notifier(&ocrdma_inet6addr_notifier); | 558 | status = register_inet6addr_notifier(&ocrdma_inet6addr_notifier); |
554 | if (status) | 559 | if (status) |
555 | return status; | 560 | goto err_notifier6; |
556 | #endif | 561 | #endif |
557 | 562 | ||
558 | status = be_roce_register_driver(&ocrdma_drv); | 563 | status = be_roce_register_driver(&ocrdma_drv); |
559 | if (status) | 564 | if (status) |
560 | ocrdma_unregister_inet6addr_notifier(); | 565 | goto err_be_reg; |
561 | 566 | ||
567 | return 0; | ||
568 | |||
569 | err_be_reg: | ||
570 | ocrdma_unregister_inet6addr_notifier(); | ||
571 | err_notifier6: | ||
572 | ocrdma_unregister_inetaddr_notifier(); | ||
562 | return status; | 573 | return status; |
563 | } | 574 | } |
564 | 575 | ||
@@ -566,6 +577,7 @@ static void __exit ocrdma_exit_module(void) | |||
566 | { | 577 | { |
567 | be_roce_unregister_driver(&ocrdma_drv); | 578 | be_roce_unregister_driver(&ocrdma_drv); |
568 | ocrdma_unregister_inet6addr_notifier(); | 579 | ocrdma_unregister_inet6addr_notifier(); |
580 | ocrdma_unregister_inetaddr_notifier(); | ||
569 | ocrdma_rem_debugfs(); | 581 | ocrdma_rem_debugfs(); |
570 | } | 582 | } |
571 | 583 | ||