Change-Id: I2a911a6926f6b2595b26b367754817ba66396dd3
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
#include <linux/slab.h>
#include <linux/dcache.h>
+
+static void img_del_ip_by_list(struct img_ip *ip);
+
struct img_file *create_img_file(struct dentry *dentry)
{
struct img_file *file;
void free_img_file(struct img_file *file)
{
- /* FIXME: */
+ struct img_ip *ip, *tmp;
+
+ list_for_each_entry_safe(ip, tmp, &file->ip_list, list) {
+ img_del_ip_by_list(ip);
+ free_img_ip(ip);
+ }
+
+ kfree(file);
}
static void img_add_ip_by_list(struct img_file *file, struct img_ip *ip)
#include "img_file.h"
#include <linux/slab.h>
+static void img_del_file_by_list(struct img_file *file);
+
struct img_proc *create_img_proc(void)
{
struct img_proc *proc;
void free_img_proc(struct img_proc *ip)
{
- /* FIXME: */
+ struct img_file *file, *tmp;
+
+ list_for_each_entry_safe(file, tmp, &ip->file_list, list) {
+ img_del_file_by_list(file);
+ free_img_file(file);
+ }
+
+ kfree(ip);
}
static void img_add_file_by_list(struct img_proc *proc, struct img_file *file)