Commit 310fc0b5 authored by yidong0635's avatar yidong0635 Committed by Ben Walker
Browse files

scsi_bdev_ut: add SPDK_CU_ASSERT_FATAL before put task.



Like other test, need to add SPDK_CU_ASSERT_FATAL(TAILQ_EMPTY(&g_bdev_io_queue)).
To avoid issue:
scsi_bdev_ut.c:956:2: warning: Address of stack memory associated with local
variable 'task' is still referred to by the global variable 'g_io_wait_queue'
 upon returning to the caller.  This will be a dangling reference
        ut_put_task(&task);
        ^~~~~~~~~~~~~~~~~~
waiting exit from while loop in ut_bdev_io_flush.

This is related to issue #822.

Change-Id: If390f5076582a0149646f0c2a408c3bcd3b4fab6
Signed-off-by: default avataryidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459534


Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 9c9709b9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -953,6 +953,8 @@ _xfer_test(bool bdev_io_pool_full)
	CU_ASSERT(task.status == SPDK_SCSI_STATUS_GOOD);
	CU_ASSERT(g_scsi_cb_called == 1);
	g_scsi_cb_called = 0;
	SPDK_CU_ASSERT_FATAL(TAILQ_EMPTY(&g_bdev_io_queue));

	ut_put_task(&task);
}