]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
RDMA/bnxt_re: Fix issue in the unload path
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Tue, 4 Feb 2025 08:21:24 +0000 (00:21 -0800)
committerLeon Romanovsky <leon@kernel.org>
Mon, 10 Feb 2025 08:39:25 +0000 (03:39 -0500)
The cited comment removed the netdev notifier register call
from the driver. But, it did not remove the cleanup code from
the unload path. As a result, driver unload is not clean and
resulted in undesired behaviour.

Fixes: d3b15fcc4201 ("RDMA/bnxt_re: Remove deliver net device event")
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Link: https://patch.msgid.link/1738657285-23968-4-git-send-email-selvin.xavier@broadcom.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/bnxt_re/bnxt_re.h
drivers/infiniband/hw/bnxt_re/main.c

index b91a85a491d056a4aba8f83e7283e7841fe50a04..3721446c6ba4b0bdfaf705d56db8e9c12ef71dec 100644 (file)
@@ -187,7 +187,6 @@ struct bnxt_re_dev {
 #define BNXT_RE_FLAG_ISSUE_ROCE_STATS          29
        struct net_device               *netdev;
        struct auxiliary_device         *adev;
-       struct notifier_block           nb;
        unsigned int                    version, major, minor;
        struct bnxt_qplib_chip_ctx      *chip_ctx;
        struct bnxt_en_dev              *en_dev;
index 89ac5c21ca7adb330751a0537942dab2e50db1ba..a94c8c5387d9e3f081da6e8b04a0ba0f4fb823c8 100644 (file)
@@ -1359,7 +1359,6 @@ static struct bnxt_re_dev *bnxt_re_dev_add(struct auxiliary_device *adev,
                return NULL;
        }
        /* Default values */
-       rdev->nb.notifier_call = NULL;
        rdev->netdev = en_dev->net;
        rdev->en_dev = en_dev;
        rdev->adev = adev;
@@ -2354,15 +2353,6 @@ exit:
 static void bnxt_re_remove_device(struct bnxt_re_dev *rdev, u8 op_type,
                                  struct auxiliary_device *aux_dev)
 {
-       if (rdev->nb.notifier_call) {
-               unregister_netdevice_notifier(&rdev->nb);
-               rdev->nb.notifier_call = NULL;
-       } else {
-               /* If notifier is null, we should have already done a
-                * clean up before coming here.
-                */
-               return;
-       }
        bnxt_re_setup_cc(rdev, false);
        ib_unregister_device(&rdev->ibdev);
        bnxt_re_dev_uninit(rdev, op_type);