]> git.hungrycats.org Git - linux/commit
net: tls: reshuffle the device ops check
authorJakub Kicinski <kuba@kernel.org>
Wed, 29 Apr 2026 21:30:01 +0000 (14:30 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 1 May 2026 23:46:30 +0000 (16:46 -0700)
commitfa11b40480132077de3787cf2122646b0c8ecc41
tree47b9eccdf29ae5ee8324b64d21b1970ec356e2e1
parentedf4bee4215a173c0534d1851d7523d827149f9e
net: tls: reshuffle the device ops check

We try to validate during registration that the netdev
has ops if it has features. This is currently somewhat sillily
written because we have a dereference before a NULL check
on the ops struct. Straighten this out.

No functional change intended other than saving ourselves
the very theoretical crash with a bad driver.

Note that we check earlier in the function that either ops
or TLS features are set for the device in question.

Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260429213001.1908235-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/tls/tls_device.c