Commit 75dce8a2 authored by Ziye Yang's avatar Ziye Yang Committed by Jim Harris
Browse files

iscsi, initiator: solve the use after issue.



In our current code, when we call the following statement:
spdk_bdev_destruct_done(&lun->bdev, 0);

Actually lun is already freed in bdev_iscsi_lun_cleanup function
(called by iscsi_free_lun). So this patch can be used to
prevent this issue by changing the order.

Change-Id: I5ec02319b8205fafc4d8074511f5a334b9bbb3ad
Signed-off-by: default avatarZiye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/417630


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 2d7cfda2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -295,8 +295,8 @@ bdev_iscsi_destruct_cb(void *ctx)
	struct bdev_iscsi_lun *lun = ctx;

	spdk_poller_unregister(&lun->no_master_ch_poller);
	bdev_iscsi_lun_cleanup(lun);
	spdk_bdev_destruct_done(&lun->bdev, 0);
	bdev_iscsi_lun_cleanup(lun);
}

static int