diff options
| author | Daniel Zahka <daniel.zahka@gmail.com> | 2026-08-14 04:44:06 -0700 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-08-17 11:02:07 -0700 |
| commit | cf85f810f911234a06a4ef2439e8694b93b717fc (patch) | |
| tree | b4dc0672330d7dfebd2208a87acbe6b70cb02b48 /net | |
| parent | 96bf660d4c14948293fe5d8e26d2de536f8eb1d8 (diff) | |
net: psp: use psp_dev_is_registered() in psp_assoc_free()
No functional changes.
In code paths that use a psp_dev reference that wasn't obtained from
the psp_devs xarray, e.g. not via psp_device_get_and_lock(), there is
no guarantee that the psp_dev has not been unregistered. The check
here is correct, but it doesn't match other code paths that use
psp_dev_is_registered().
Commit b89769f936a8 ("net: psp: check for device unregister when
creating assoc") is an example of a fix that adds a check for this
after locking a psp_dev. if (psp_dev_is_registered(psd)) vs if
(psd->ops) makes it clear what we are really checking for.
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
Link: https://patch.msgid.link/20260814-psp-dev-is-reg-v1-1-5029e1f1eb01@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net')
| -rw-r--r-- | net/psp/psp_sock.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/psp/psp_sock.c b/net/psp/psp_sock.c index 07dc4cf741f3..1a2a6b7516b0 100644 --- a/net/psp/psp_sock.c +++ b/net/psp/psp_sock.c @@ -96,7 +96,7 @@ static void psp_assoc_free(struct work_struct *work) struct psp_dev *psd = pas->psd; mutex_lock(&psd->lock); - if (psd->ops) + if (psp_dev_is_registered(psd)) psp_dev_tx_key_del(psd, pas); mutex_unlock(&psd->lock); psp_dev_put(psd); |
