Fix dentry leaks from swap_preload module 39/195339/2
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Wed, 12 Dec 2018 19:24:05 +0000 (22:24 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 13 Dec 2018 19:55:40 +0000 (22:55 +0300)
Add missed call probe_info_unit() for deinitialize 'probe_info'

Change-Id: I6c9506e64c6ebd2d90b1b1bde6b029d77defba3b
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
modules/us_manager/sspt/sspt_file.c
modules/us_manager/sspt/sspt_ip.c

index 417c94982958d27fb459c7f1cd9eee7d27efa0d1..95deccece5e144d07968803c1fe7e225a1fcb286 100644 (file)
@@ -217,18 +217,14 @@ void sspt_file_add_ip(struct sspt_file *file, struct img_ip *img_ip)
 {
        unsigned long offset = 0;
        struct sspt_page *page = NULL;
-       struct sspt_ip *ip = NULL;
 
        offset = img_ip->addr & PAGE_MASK;
        page = sspt_find_page_or_new(file, offset);
        if (!page)
                return;
 
-       ip = sspt_ip_create(img_ip, page);
-       if (!ip)
-               return;
-
-       probe_info_init(ip->desc->type, ip);
+       /* Created the "ip" automatically added itself to necessary lists */
+       sspt_ip_create(img_ip, page);
 }
 
 void sspt_file_on_each_ip(struct sspt_file *file,
index e36f80a722c39b0e6849828a950aff00b0e500df..94ce35723fa9b1aa5370f360d94327e637c56bb7 100644 (file)
@@ -54,6 +54,7 @@ struct sspt_ip *sspt_ip_create(struct img_ip *img_ip, struct sspt_page *page)
        ip->offset = img_ip->addr & ~PAGE_MASK;
        ip->desc = img_ip->desc;
        atomic_set(&ip->usage, 2);      /* for 'img_ip' and 'page' */
+       probe_info_init(ip->desc->type, ip);
 
        /* add to img_ip list */
        img_ip_get(img_ip);
@@ -74,6 +75,7 @@ static void sspt_ip_free(struct sspt_ip *ip)
 {
        WARN_ON(!list_empty(&ip->list) || !list_empty(&ip->img_list));
 
+       probe_info_uninit(ip->desc->type, ip);
        kfree(ip);
 }