Improve robustness of the code that restores .queue_pdu()

In my tests I hit a stack overflow caused by infinite recursion of
.queue_pdu() calls, caused by .queue_pdu() not being restored in an
error path. Make the approach for restoring .queue_pdu() more robust.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
This commit is contained in:
Bart Van Assche
2019-11-03 14:59:11 -08:00
parent 10599fcd4f
commit cc3ddbff42
10 changed files with 19 additions and 52 deletions
+2
View File
@@ -35,6 +35,8 @@
/* globals between setup, tests, and teardown */
extern struct scsi_task *task;
extern unsigned char *read_write_buf;
extern int (*orig_queue_pdu)(struct iscsi_context *iscsi,
struct iscsi_pdu *pdu);
#ifndef HAVE_CU_SUITEINFO_PSETUPFUNC
/* libcunit version 1 */