drbd: fix memory leak in drbd_adm_resize
authorOleg Drokin <green@linuxhacker.ru>
Sun, 26 Apr 2015 05:28:43 +0000 (01:28 -0400)
committerJens Axboe <axboe@fb.com>
Wed, 25 Nov 2015 16:22:03 +0000 (09:22 -0700)
commit706447861bb210cf2fb6a58bc1d29a6636175987
treeb81c71120e9589293608495d1236752d76209023
parent5bded4effb601d9f92382db38fd501f98692eb2d
drbd: fix memory leak in drbd_adm_resize

new_disk_conf could be leaked if the follow on checks fail,
so make sure to free it on error if it was not assigned yet.

Found with smatch.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/drbd/drbd_nl.c