diff options
author | trasz <trasz@FreeBSD.org> | 2013-09-24 09:33:31 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2013-09-24 09:33:31 +0000 |
commit | 22453ebd122d5a687b8a4239b30e6f9e5f2a93aa (patch) | |
tree | 0a3cc44a0707712fbcf115ad08b941b0f799fc63 /sys/cam | |
parent | a836e0c53672e740737d2dff33568f7a0bf2974e (diff) | |
download | FreeBSD-src-22453ebd122d5a687b8a4239b30e6f9e5f2a93aa.zip FreeBSD-src-22453ebd122d5a687b8a4239b30e6f9e5f2a93aa.tar.gz |
Fix a few instances of M_WAITOK in threads marked as prohibited from sleep,
missed in r255824.
Approved by: re (kib)
Sponsored by: FreeBSD Foundation
Diffstat (limited to 'sys/cam')
-rw-r--r-- | sys/cam/ctl/ctl_frontend_iscsi.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sys/cam/ctl/ctl_frontend_iscsi.c b/sys/cam/ctl/ctl_frontend_iscsi.c index 60204f5..064285d 100644 --- a/sys/cam/ctl/ctl_frontend_iscsi.c +++ b/sys/cam/ctl/ctl_frontend_iscsi.c @@ -2306,6 +2306,7 @@ cfiscsi_datamove(union ctl_io *io) if (response == NULL) { CFISCSI_SESSION_WARN(cs, "failed to " "allocate memory; dropping connection"); + icl_pdu_free(request); cfiscsi_session_terminate(cs); return; } @@ -2337,6 +2338,7 @@ cfiscsi_datamove(union ctl_io *io) if (error != 0) { CFISCSI_SESSION_WARN(cs, "failed to " "allocate memory; dropping connection"); + icl_pdu_free(request); icl_pdu_free(response); cfiscsi_session_terminate(cs); return; @@ -2406,7 +2408,13 @@ cfiscsi_datamove(union ctl_io *io) "task tag 0x%x, target transfer tag 0x%x", bhssc->bhssc_initiator_task_tag, target_transfer_tag); #endif - cdw = uma_zalloc(cfiscsi_data_wait_zone, M_WAITOK | M_ZERO); + cdw = uma_zalloc(cfiscsi_data_wait_zone, M_NOWAIT | M_ZERO); + if (cdw == NULL) { + CFISCSI_SESSION_WARN(cs, "failed to " + "allocate memory; dropping connection"); + icl_pdu_free(request); + cfiscsi_session_terminate(cs); + } cdw->cdw_ctl_io = io; cdw->cdw_target_transfer_tag = htonl(target_transfer_tag); cdw->cdw_initiator_task_tag = bhssc->bhssc_initiator_task_tag; @@ -2435,7 +2443,13 @@ cfiscsi_datamove(union ctl_io *io) * XXX: We should limit the number of outstanding R2T PDUs * per task to MaxOutstandingR2T. */ - response = cfiscsi_pdu_new_response(request, M_WAITOK); + response = cfiscsi_pdu_new_response(request, M_NOWAIT); + if (response == NULL) { + CFISCSI_SESSION_WARN(cs, "failed to " + "allocate memory; dropping connection"); + icl_pdu_free(request); + cfiscsi_session_terminate(cs); + } bhsr2t = (struct iscsi_bhs_r2t *)response->ip_bhs; bhsr2t->bhsr2t_opcode = ISCSI_BHS_OPCODE_R2T; bhsr2t->bhsr2t_flags = 0x80; |