diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2015-08-31 15:21:39 +0300 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-11-13 13:19:56 -0500 |
commit | 0f9d268d33632ff869d2ebaab2631fd23de7212e (patch) | |
tree | 42d8514368dc1806b641b271b3f2a7c43d1f356c /drivers | |
parent | 587075664c04347cf92844d11a0463951ff4514d (diff) |
rbd: fix double free on rbd_dev->header_name
[ Upstream commit 3ebe138ac642a195c7f2efdb918f464734421fd6 ]
If rbd_dev_image_probe() in rbd_dev_probe_parent() fails, header_name
is freed twice: once in rbd_dev_probe_parent() and then in its caller
rbd_dev_image_probe() (rbd_dev_image_probe() is called recursively to
handle parent images).
rbd_dev_probe_parent() is responsible for probing the parent, so it
shouldn't muck with clone's fields.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/rbd.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index dc1ca84e90f1..7327c36f4fc9 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -5198,7 +5198,6 @@ static int rbd_dev_probe_parent(struct rbd_device *rbd_dev) out_err: if (parent) { rbd_dev_unparent(rbd_dev); - kfree(rbd_dev->header_name); rbd_dev_destroy(parent); } else { rbd_put_client(rbdc); |