Skip to content

Commit 3ebe138

Browse files
committed
rbd: fix double free on rbd_dev->header_name
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>
1 parent 6dd74e4 commit 3ebe138

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

drivers/block/rbd.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5201,7 +5201,6 @@ static int rbd_dev_probe_parent(struct rbd_device *rbd_dev)
52015201
out_err:
52025202
if (parent) {
52035203
rbd_dev_unparent(rbd_dev);
5204-
kfree(rbd_dev->header_name);
52055204
rbd_dev_destroy(parent);
52065205
} else {
52075206
rbd_put_client(rbdc);

0 commit comments

Comments
 (0)