bdev/rbd: fix memory leak and spdk_io_device_register fail

io_device is registered, but never release.
It will lead spdk_io_device_register to fail
because allocate new io_device may reuse the same memory address.

Change-Id: I3359ed783c1df43ef382669d9d73d06bfbc1fe2d
Signed-off-by: Li Feng <lifeng1519@gmail.com>
Reviewed-on: https://review.gerrithub.io/424235
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Li Feng 2018-08-31 21:39:27 +08:00 committed by Jim Harris
parent fd94895432
commit 3f6a54c1a7

View File

@ -312,6 +312,8 @@ bdev_rbd_destruct(void *ctx)
{
struct bdev_rbd *rbd = ctx;
spdk_io_device_unregister(rbd, NULL);
bdev_rbd_free(rbd);
return 0;
}