diff --git a/iscsi-scst/kernel/isert-scst/iser_buf.c b/iscsi-scst/kernel/isert-scst/iser_buf.c index b84a68f68..9d6488760 100644 --- a/iscsi-scst/kernel/isert-scst/iser_buf.c +++ b/iscsi-scst/kernel/isert-scst/iser_buf.c @@ -294,6 +294,7 @@ out: void isert_wr_release(struct isert_wr *wr) { struct isert_buf *isert_buf = wr->buf; + if (isert_buf && isert_buf->is_alloced) { struct isert_device *isert_dev = wr->isert_dev; struct ib_device *ib_dev; diff --git a/iscsi-scst/kernel/isert-scst/iser_datamover.c b/iscsi-scst/kernel/isert-scst/iser_datamover.c index 19fc58640..4b0c287bc 100644 --- a/iscsi-scst/kernel/isert-scst/iser_datamover.c +++ b/iscsi-scst/kernel/isert-scst/iser_datamover.c @@ -107,6 +107,7 @@ int isert_portal_remove(void *portal_h) void isert_free_connection(struct iscsi_conn *iscsi_conn) { struct isert_connection *isert_conn = (struct isert_connection *)iscsi_conn; + isert_post_drain(isert_conn); isert_conn_free(isert_conn); } diff --git a/iscsi-scst/kernel/isert-scst/iser_pdu.c b/iscsi-scst/kernel/isert-scst/iser_pdu.c index 4a23d06c9..bf94209c6 100644 --- a/iscsi-scst/kernel/isert-scst/iser_pdu.c +++ b/iscsi-scst/kernel/isert-scst/iser_pdu.c @@ -82,6 +82,7 @@ static int isert_rx_pdu_init(struct isert_cmnd *isert_pdu, { struct iscsi_cmnd *iscsi_cmnd = &isert_pdu->iscsi; int err = isert_pdu_rx_buf_init(isert_pdu, isert_conn); + if (unlikely(err < 0)) return err; iscsi_cmnd->conn = &isert_conn->iscsi; diff --git a/iscsi-scst/kernel/isert-scst/isert_login.c b/iscsi-scst/kernel/isert-scst/isert_login.c index 1e15f89c8..517a6f257 100644 --- a/iscsi-scst/kernel/isert-scst/isert_login.c +++ b/iscsi-scst/kernel/isert-scst/isert_login.c @@ -567,6 +567,7 @@ static ssize_t isert_read(struct file *filp, char __user *buf, size_t count, if (will_read_block(dev)) { int ret; + if (filp->f_flags & O_NONBLOCK) return -EAGAIN; ret = wait_event_freezable(dev->waitqueue,