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)
committerJakub Kicinski <kuba@kernel.org>
Wed, 14 Dec 2022 02:58:08 +0000 (18:58 -0800)
commitf3b4a00f0f62da252c598310698dfc82ef2f2e2e
tree2878ea475fa9707cf2d46cea77029f060c1ae296
parent7e68dd7d07a28faa2e6574dd6b9dbd90cdeaae91
net: macsec: fix net device access prior to holding a lock

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>
drivers/net/macsec.c