Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

psp: rename our psp_dev_destroy()

psp_dev_destroy() was already used in drivers/crypto/ccp/psp-dev.c

Use psp_dev_free() instead, to avoid a link error when
CRYPTO_DEV_SP_CCP=y

Fixes: 00c94ca2b99e ("psp: base PSP device support")
Closes: https://lore.kernel.org/netdev/CANn89i+ZdBDEV6TE=Nw5gn9ycTzWw4mZOpPuCswgwEsrgOyNnw@mail.gmail.com/
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Daniel Zahka <daniel.zahka@gmail.com>
Link: https://patch.msgid.link/20250918113546.177946-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Eric Dumazet and committed by
Jakub Kicinski
672beab0 7b712146

+4 -4
+2 -2
net/psp/psp.h
··· 13 13 extern struct xarray psp_devs; 14 14 extern struct mutex psp_devs_lock; 15 15 16 - void psp_dev_destroy(struct psp_dev *psd); 16 + void psp_dev_free(struct psp_dev *psd); 17 17 int psp_dev_check_access(struct psp_dev *psd, struct net *net); 18 18 19 19 void psp_nl_notify_dev(struct psp_dev *psd, u32 cmd); ··· 42 42 static inline void psp_dev_put(struct psp_dev *psd) 43 43 { 44 44 if (refcount_dec_and_test(&psd->refcnt)) 45 - psp_dev_destroy(psd); 45 + psp_dev_free(psd); 46 46 } 47 47 48 48 static inline bool psp_dev_is_registered(struct psp_dev *psd)
+2 -2
net/psp/psp_main.c
··· 99 99 } 100 100 EXPORT_SYMBOL(psp_dev_create); 101 101 102 - void psp_dev_destroy(struct psp_dev *psd) 102 + void psp_dev_free(struct psp_dev *psd) 103 103 { 104 104 mutex_lock(&psp_devs_lock); 105 105 xa_erase(&psp_devs, psd->id); ··· 122 122 123 123 psp_nl_notify_dev(psd, PSP_CMD_DEV_DEL_NTF); 124 124 125 - /* Wait until psp_dev_destroy() to call xa_erase() to prevent a 125 + /* Wait until psp_dev_free() to call xa_erase() to prevent a 126 126 * different psd from being added to the xarray with this id, while 127 127 * there are still references to this psd being held. 128 128 */