libceph, ceph: avoid memory leak when specifying same option several times
authorChengguang Xu <cgxu519@icloud.com>
Tue, 6 Feb 2018 00:25:55 +0000 (08:25 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 May 2018 05:52:04 +0000 (07:52 +0200)
commite080e814deb129f1e3b928af58f61177bd8e8dab
tree8fcbf948811e0a387a008e9b11cc3c8f3605d071
parent682def914242d13b41c1196e01582d05008ffd43
libceph, ceph: avoid memory leak when specifying same option several times

[ Upstream commit 937441f3a3158d5510ca8cc78a82453f57a96365 ]

When parsing string option, in order to avoid memory leak we need to
carefully free it first in case of specifying same option several times.

Signed-off-by: Chengguang Xu <cgxu519@icloud.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ceph/super.c
net/ceph/ceph_common.c