configfs: fix memleak in configfs_release_bin_file
authorChung-Chiang Cheng <shepjeng@gmail.com>
Fri, 18 Jun 2021 07:59:25 +0000 (15:59 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:56:48 +0000 (16:56 +0200)
commit5f2dfce8d8bc8484f0add19dbedb5d5a077adcdd
treebe19790411a9edde12ad7b874d25c76a76de0a0b
parente30e636447fd6d08908777818dfbc4fcbcd3f66a
configfs: fix memleak in configfs_release_bin_file

[ Upstream commit 3c252b087de08d3cb32468b54a158bd7ad0ae2f7 ]

When reading binary attributes in progress, buffer->bin_buffer is setup in
configfs_read_bin_file() but never freed.

Fixes: 03607ace807b4 ("configfs: implement binary attributes")
Signed-off-by: Chung-Chiang Cheng <cccheng@synology.com>
[hch: move the vfree rather than duplicating it]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/configfs/file.c