net: macsec: fix net device access prior to holding a lock
authorEmeel Hakim <ehakim@nvidia.com>
Sun, 11 Dec 2022 07:55:32 +0000 (09:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:37 +0000 (13:14 +0100)
commit0578f9929fd3e1e00ba67cb8c277e73b11bbcaf3
tree6a0cc1c020b5d86f9899d6cbdb65e1aca3e18943
parenta472f069ced8601979f53c13c0cf20236074ed46
net: macsec: fix net device access prior to holding a lock

[ Upstream commit f3b4a00f0f62da252c598310698dfc82ef2f2e2e ]

Currently macsec offload selection update routine accesses
the net device prior to holding the relevant lock.
Fix by holding the lock prior to the device access.

Fixes: dcb780fb2795 ("net: macsec: add nla support for changing the offloading selection")
Reviewed-by: Raed Salem <raeds@nvidia.com>
Signed-off-by: Emeel Hakim <ehakim@nvidia.com>
Link: https://lore.kernel.org/r/20221211075532.28099-1-ehakim@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/macsec.c