drbd: fix memory leak
authorLars Ellenberg <lars.ellenberg@linbit.com>
Wed, 27 Mar 2013 13:08:42 +0000 (14:08 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 28 Mar 2013 16:10:25 +0000 (10:10 -0600)
We forgot to free the disk_conf,
so for each attach/detach cycle we leaked 336 bytes.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/drbd/drbd_main.c

index 67d2bb3..1b93a72 100644 (file)
@@ -2819,6 +2819,7 @@ void drbd_free_bc(struct drbd_backing_dev *ldev)
        blkdev_put(ldev->backing_bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL);
        blkdev_put(ldev->md_bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL);
 
+       kfree(ldev->disk_conf);
        kfree(ldev);
 }