Message ID | 20230704142113.581071-5-cascardo@canonical.com |
---|---|
State | New |
Headers | show |
Series | CVE-2023-3439 | expand |
diff --git a/net/mctp/device.c b/net/mctp/device.c index 7904eb599904..5d3527b3b9c2 100644 --- a/net/mctp/device.c +++ b/net/mctp/device.c @@ -269,6 +269,7 @@ void mctp_dev_hold(struct mctp_dev *mdev) void mctp_dev_put(struct mctp_dev *mdev) { if (mdev && refcount_dec_and_test(&mdev->refs)) { + kfree(mdev->addrs); dev_put(mdev->dev); kfree_rcu(mdev, rcu); } @@ -365,7 +366,6 @@ static void mctp_unregister(struct net_device *dev) mctp_route_remove_dev(mdev); mctp_neigh_remove_dev(mdev); - kfree(mdev->addrs); mctp_dev_put(mdev); }