]> git.baikalelectronics.ru Git - kernel.git/commit
ubifs: Fix memory leak bug in alloc_ubifs_info() error path
authorWenwen Wang <wenwen@cs.uga.edu>
Tue, 20 Aug 2019 04:44:24 +0000 (23:44 -0500)
committerRichard Weinberger <richard@nod.at>
Sun, 15 Sep 2019 20:12:20 +0000 (22:12 +0200)
commita11e1192537126a2bd05b668b465179a31045e5e
tree7d3908f114eb453aa03338a59731e7041acd728d
parent69980ac32599d717a170c480319fa06fa0b20585
ubifs: Fix memory leak bug in alloc_ubifs_info() error path

In ubifs_mount(), 'c' is allocated through kzalloc() in alloc_ubifs_info().
However, it is not deallocated in the following execution if
ubifs_fill_super() fails, leading to a memory leak bug. To fix this issue,
free 'c' before going to the 'out_deact' label.

Fixes: 974763da840d ("UBIFS: add new flash file system")
Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/super.c