From: Christian Brauner Date: Thu, 27 Jun 2024 14:11:40 +0000 (+0200) Subject: nsproxy: add a cleanup helper for nsproxy X-Git-Tag: v6.11-rc1~234^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d057c108155ab8d02b603c7ee5da7df615c2f32f;p=thirdparty%2Flinux.git nsproxy: add a cleanup helper for nsproxy Add a simple cleanup helper for nsproxy. Link: https://lore.kernel.org/r/20240627-work-pidfs-v1-2-7e9ab6cc3bb1@kernel.org Reviewed-by: Jeff Layton Reviewed-by: Josef Bacik Reviewed-by: Alexander Mikhalitsyn Signed-off-by: Christian Brauner --- diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h index 5601d14e28869..e6bec522b1391 100644 --- a/include/linux/nsproxy.h +++ b/include/linux/nsproxy.h @@ -112,4 +112,6 @@ static inline void get_nsproxy(struct nsproxy *ns) refcount_inc(&ns->count); } +DEFINE_FREE(put_nsproxy, struct nsproxy *, if (_T) put_nsproxy(_T)) + #endif