summaryrefslogtreecommitdiff
path: root/net/mctp
diff options
context:
space:
mode:
authorMatt Johnston <matt@codeconstruct.com.au>2022-02-25 08:39:36 +0300
committerJoel Stanley <joel@jms.id.au>2022-03-18 03:39:04 +0300
commitd0a58715ecde5c8d492d0c38f0f983ad32c5ef24 (patch)
tree0f11263101b30441566645260ae6178a6e1bf31e /net/mctp
parentb80fd2a771ad35559434ca0d4bda65490e5740c6 (diff)
downloadlinux-d0a58715ecde5c8d492d0c38f0f983ad32c5ef24.tar.xz
mctp: Avoid warning if unregister notifies twice
Previously if an unregister notify handler ran twice (waiting for netdev to be released) it would print a warning in mctp_unregister() every subsequent time the unregister notify occured. Instead we only need to worry about the case where a mctp_ptr is set on an unknown device type. OpenBMC-Staging-Count: 1 Signed-off-by: Matt Johnston <matt@codeconstruct.com.au> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'net/mctp')
-rw-r--r--net/mctp/device.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/mctp/device.c b/net/mctp/device.c
index ff85c09e34ce..ffcd7d8d2fb6 100644
--- a/net/mctp/device.c
+++ b/net/mctp/device.c
@@ -427,10 +427,10 @@ static void mctp_unregister(struct net_device *dev)
struct mctp_dev *mdev;
mdev = mctp_dev_get_rtnl(dev);
- if (mctp_known(dev) != (bool)mdev) {
+ if (mdev && !mctp_known(dev)) {
// Sanity check, should match what was set in mctp_register
- netdev_warn(dev, "%s: mdev pointer %d but type (%d) match is %d",
- __func__, (bool)mdev, mctp_known(dev), dev->type);
+ netdev_warn(dev, "%s: BUG mctp_ptr set for unknown type %d",
+ __func__, dev->type);
return;
}
if (!mdev)
@@ -454,7 +454,7 @@ static int mctp_register(struct net_device *dev)
if (mdev) {
if (!mctp_known(dev))
- netdev_warn(dev, "%s: mctp_dev set for unknown type %d",
+ netdev_warn(dev, "%s: BUG mctp_ptr set for unknown type %d",
__func__, dev->type);
return 0;
}