mctp: Remove device type check at unregister
authorMatt Johnston <matt@codeconstruct.com.au>
Thu, 15 Dec 2022 05:49:33 +0000 (13:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:56 +0000 (13:32 +0100)
commit7b606804bbf0808e7f0c23a96e9c8446bbfbadf8
tree6da07a9d6d1bae29b11bf3ef57b5525d6a832232
parent96ea05df9ed54895f8e459029b50066c0dc18086
mctp: Remove device type check at unregister

[ Upstream commit b389a902dd5be4ece505a2e0463b9b034de04bf5 ]

The unregister 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

Neither check at register or unregister is required. They were 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@codeconstruct.com.au>
Link: https://lore.kernel.org/r/20221215054933.2403401-1-matt@codeconstruct.com.au
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/mctp/device.c