diff mbox series

[RFC,2/4] nsproxy: add a cleanup helper for nsproxy

Message ID 20240627-work-pidfs-v1-2-7e9ab6cc3bb1@kernel.org (mailing list archive)
State New
Headers show
Series pidfs: allow retrieval of namespace descriptors | expand

Commit Message

Christian Brauner June 27, 2024, 2:11 p.m. UTC
Add a simple cleanup helper for nsproxy.

Signed-off-by: Christian Brauner <brauner@kernel.org>
---
 include/linux/nsproxy.h | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h
index 5601d14e2886..e6bec522b139 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