From ac75e3648e6a9c3a8cf45d5fa491abd3a3ab3613 Mon Sep 17 00:00:00 2001 From: Jeremie Koenig Date: Tue, 17 Aug 2010 16:48:55 +0000 Subject: Fix the failure semantics of procfs_make_node * procfs.c (procfs_make_node): Invoke the cleanup callback on failure, so that callers don't have to. * procfs.h: Document the change. * procfs_dir.c (procfs_dir_make_node), procfs_file.c (procfs_file_make_node), proclist.c (proclist_make_node): Update to reflect the change. --- procfs.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'procfs.h') diff --git a/procfs.h b/procfs.h index 0557b6d..21b0f93 100644 --- a/procfs.h +++ b/procfs.h @@ -29,6 +29,8 @@ struct procfs_node_ops void (*cleanup) (void *hook); }; +/* Create a new node and return it. Returns NULL if it fails to allocate + enough memory. In this case, ops->cleanup will be invoked. */ struct node *procfs_make_node (const struct procfs_node_ops *ops, void *hook); -- cgit v1.2.3