[FIX] usage of kfree'd memory 04/44504/3
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Wed, 22 Jul 2015 15:29:59 +0000 (18:29 +0300)
committerDmitry Kovalenko <d.kovalenko@samsung.com>
Thu, 23 Jul 2015 09:55:39 +0000 (02:55 -0700)
pfg_item_free(item) tries to access item->pfg so
put_pf_group(item->pfg) should be executed after pfg_item_free.

Change-Id: I28c0059a6c99c284a4e6ef6b0f2fc4a76860166a
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
parser/us_inst.c

index 0dfa30c..17c699b 100644 (file)
@@ -132,9 +132,11 @@ void pfg_put_all(void)
        spin_unlock(&pfg_item_lock);
 
        list_for_each_entry_safe(item, n, &tmp_list, list) {
+               struct pf_group *pfg = item->pfg;
+
                list_del(&item->list);
-               put_pf_group(item->pfg);
                pfg_item_free(item);
+               put_pf_group(pfg);
        }
 }