diff options
author | Joel Becker <joel.becker@oracle.com> | 2006-04-12 21:34:43 -0400 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2006-06-29 17:38:53 -0400 |
commit | 22dd0e88b70f5faa3a0101081e290431c3439189 (patch) | |
tree | 28df8c4f1fd038f63a26561fdd53c33f2cdd4d34 /Documentation | |
parent | 8d231c11fd0b694c447e59e687754b6999eea0a2 (diff) |
configfs: Release memory in configfs_example.
The configfs_example module was missing a ->release().
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/filesystems/configfs/configfs_example.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/Documentation/filesystems/configfs/configfs_example.c b/Documentation/filesystems/configfs/configfs_example.c index 3d4713a6c207..2d6a14a463e0 100644 --- a/Documentation/filesystems/configfs/configfs_example.c +++ b/Documentation/filesystems/configfs/configfs_example.c | |||
@@ -264,6 +264,15 @@ static struct config_item_type simple_child_type = { | |||
264 | }; | 264 | }; |
265 | 265 | ||
266 | 266 | ||
267 | struct simple_children { | ||
268 | struct config_group group; | ||
269 | }; | ||
270 | |||
271 | static inline struct simple_children *to_simple_children(struct config_item *item) | ||
272 | { | ||
273 | return item ? container_of(to_config_group(item), struct simple_children, group) : NULL; | ||
274 | } | ||
275 | |||
267 | static struct config_item *simple_children_make_item(struct config_group *group, const char *name) | 276 | static struct config_item *simple_children_make_item(struct config_group *group, const char *name) |
268 | { | 277 | { |
269 | struct simple_child *simple_child; | 278 | struct simple_child *simple_child; |
@@ -304,7 +313,13 @@ static ssize_t simple_children_attr_show(struct config_item *item, | |||
304 | "items have only one attribute that is readable and writeable.\n"); | 313 | "items have only one attribute that is readable and writeable.\n"); |
305 | } | 314 | } |
306 | 315 | ||
316 | static void simple_children_release(struct config_item *item) | ||
317 | { | ||
318 | kfree(to_simple_children(item)); | ||
319 | } | ||
320 | |||
307 | static struct configfs_item_operations simple_children_item_ops = { | 321 | static struct configfs_item_operations simple_children_item_ops = { |
322 | .release = simple_children_release, | ||
308 | .show_attribute = simple_children_attr_show, | 323 | .show_attribute = simple_children_attr_show, |
309 | }; | 324 | }; |
310 | 325 | ||
@@ -345,10 +360,6 @@ static struct configfs_subsystem simple_children_subsys = { | |||
345 | * children of its own. | 360 | * children of its own. |
346 | */ | 361 | */ |
347 | 362 | ||
348 | struct simple_children { | ||
349 | struct config_group group; | ||
350 | }; | ||
351 | |||
352 | static struct config_group *group_children_make_group(struct config_group *group, const char *name) | 363 | static struct config_group *group_children_make_group(struct config_group *group, const char *name) |
353 | { | 364 | { |
354 | struct simple_children *simple_children; | 365 | struct simple_children *simple_children; |