Re: [patch v2 1/2] Btrfs: fix possible memory leak in find_parent_nodes()

2013-08-09 Thread Jan Schmidt
On Fri, August 09, 2013 at 07:25 (+0200), Wang Shilong wrote: The origin code dealt with 'ref' as following steps: |-list_del(ref-list) |-some operations |-kfree(ref) If operations failed, it would goto label 'out' without freeing this 'ref'. and then memory

[patch v2 1/2] Btrfs: fix possible memory leak in find_parent_nodes()

2013-08-08 Thread Wang Shilong
The origin code dealt with 'ref' as following steps: |-list_del(ref-list) |-some operations |-kfree(ref) If operations failed, it would goto label 'out' without freeing this 'ref'. and then memory leak would happen.Just move list_del() after kfree() will fix the