[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221214061044.892446-1-matt@codeconstruct.com.au>
Date: Wed, 14 Dec 2022 14:10:44 +0800
From: Matt Johnston <matt@...econstruct.com.au>
To: netdev@...r.kernel.org
Cc: pabeni@...hat.com, kuba@...nel.org, edumazet@...gle.com,
davem@...emloft.net, jk@...econstruct.com.au
Subject: [PATCH net] mctp: Remove device type check at unregister
The check could be incorrectly triggered if a netdev
changes its type after register. That is possible for a tun device
using TUNSETLINK ioctl, resulting in mctp unregister failing
and the netdev unregister waiting forever.
This was encountered by https://github.com/openthread/openthread/issues/8523
The check is not required, it was added in an attempt to track down mctp_ptr
being set unexpectedly, which should not happen in normal operation.
Fixes: 7b1871af75f3 ("mctp: Warn if pointer is set for a wrong dev type")
Signed-off-by: Matt Johnston <matt@...econstruct.com.au>
---
net/mctp/device.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/net/mctp/device.c b/net/mctp/device.c
index 99a3bda8852f..dec730b5fe7e 100644
--- a/net/mctp/device.c
+++ b/net/mctp/device.c
@@ -429,12 +429,6 @@ static void mctp_unregister(struct net_device *dev)
struct mctp_dev *mdev;
mdev = mctp_dev_get_rtnl(dev);
- if (mdev && !mctp_known(dev)) {
- // Sanity check, should match what was set in mctp_register
- netdev_warn(dev, "%s: BUG mctp_ptr set for unknown type %d",
- __func__, dev->type);
- return;
- }
if (!mdev)
return;
--
2.37.2
Powered by blists - more mailing lists