]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: Fix memory leak of object lsi on error return path
authorColin Ian King <colin.king@canonical.com>
Mon, 12 Jul 2021 16:24:30 +0000 (17:24 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Tue, 20 Jul 2021 13:06:20 +0000 (15:06 +0200)
commitfc145527805ac99629ca88795748952fb5af4ffd
tree12e7175e3ca067bc778c52245fad2c6cc8ed559b
parent6e818c7f8de32c63462f5a745b7397a46ba3001b
gfs2: Fix memory leak of object lsi on error return path

In the case where IS_ERR(lsi->si_sc_inode) is true the error exit path
to free_local does not kfree the allocated object lsi leading to a memory
leak. Fix this by kfree'ing lst before taking the error exit path.

Addresses-Coverity: ("Resource leak")
Fixes: 747f335aa666 ("gfs2: lookup local statfs inodes prior to journal recovery")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/ops_fstype.c