diff options
author | Toomas Soome <tsoome@me.com> | 2019-01-18 23:27:10 +0200 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2019-04-10 09:18:20 +0300 |
commit | 1f99504ab52e6927794513144ed20e8c0ba5ea6e (patch) | |
tree | 8b3c978abf8b98002806e8a6ecfbce80397a16df | |
parent | 64a6bd963243a20fc11b593b7bec96ea000f8bf6 (diff) | |
download | illumos-joyent-1f99504ab52e6927794513144ed20e8c0ba5ea6e.tar.gz |
10662 iscsit: NULL pointer errors
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Reviewed by: Gergő Doma <domag02@gmail.com>
Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r-- | usr/src/uts/common/io/comstar/port/iscsit/iscsit.c | 22 | ||||
-rw-r--r-- | usr/src/uts/common/io/comstar/port/iscsit/iscsit_tgt.c | 22 |
2 files changed, 22 insertions, 22 deletions
diff --git a/usr/src/uts/common/io/comstar/port/iscsit/iscsit.c b/usr/src/uts/common/io/comstar/port/iscsit/iscsit.c index b8d31d00c2..3fd198a135 100644 --- a/usr/src/uts/common/io/comstar/port/iscsit/iscsit.c +++ b/usr/src/uts/common/io/comstar/port/iscsit/iscsit.c @@ -912,7 +912,7 @@ iscsit_rx_pdu(idm_conn_t *ic, idm_pdu_t *rx_pdu) * now we treat it as a protocol error. */ idm_pdu_complete(rx_pdu, IDM_STATUS_SUCCESS); - idm_conn_event(ic, CE_TRANSPORT_FAIL, NULL); + idm_conn_event(ic, CE_TRANSPORT_FAIL, 0); break; case ISCSI_OP_SCSI_TASK_MGT_MSG: if (iscsit_check_cmdsn_and_queue(rx_pdu)) { @@ -933,7 +933,7 @@ iscsit_rx_pdu(idm_conn_t *ic, idm_pdu_t *rx_pdu) default: /* Protocol error */ idm_pdu_complete(rx_pdu, IDM_STATUS_SUCCESS); - idm_conn_event(ic, CE_TRANSPORT_FAIL, NULL); + idm_conn_event(ic, CE_TRANSPORT_FAIL, 0); break; } } @@ -958,7 +958,7 @@ void iscsit_rx_scsi_rsp(idm_conn_t *ic, idm_pdu_t *rx_pdu) { idm_pdu_complete(rx_pdu, IDM_STATUS_SUCCESS); - idm_conn_event(ic, CE_TRANSPORT_FAIL, NULL); + idm_conn_event(ic, CE_TRANSPORT_FAIL, 0); } void @@ -1427,7 +1427,7 @@ iscsit_conn_logout(iscsit_conn_t *ict) */ mutex_enter(&ict->ict_mutex); if (ict->ict_lost == B_FALSE && ict->ict_destroyed == B_FALSE) { - idm_conn_event(ict->ict_ic, CE_LOGOUT_SESSION_SUCCESS, NULL); + idm_conn_event(ict->ict_ic, CE_LOGOUT_SESSION_SUCCESS, 0); } mutex_exit(&ict->ict_mutex); } @@ -1442,7 +1442,7 @@ iscsit_conn_logout(iscsit_conn_t *ict) * Target * Target portal (group?) == local port (really but we're not going to do this) * iscsit needs to map connections to local ports (whatever we decide - * they are) + * they are) * Target == ? */ @@ -2349,9 +2349,9 @@ iscsit_op_scsi_task_mgmt(iscsit_conn_t *ict, idm_pdu_t *rx_pdu) iscsit_task_t *itask; iscsit_task_t *tm_itask; scsi_task_t *task; - iscsi_scsi_task_mgt_hdr_t *iscsi_tm = + iscsi_scsi_task_mgt_hdr_t *iscsi_tm = (iscsi_scsi_task_mgt_hdr_t *)rx_pdu->isp_hdr; - iscsi_scsi_task_mgt_rsp_hdr_t *iscsi_tm_rsp = + iscsi_scsi_task_mgt_rsp_hdr_t *iscsi_tm_rsp = (iscsi_scsi_task_mgt_rsp_hdr_t *)rx_pdu->isp_hdr; uint32_t rtt, cmdsn, refcmdsn; uint8_t tm_func; @@ -2598,7 +2598,7 @@ iscsit_pdu_op_login_cmd(iscsit_conn_t *ict, idm_pdu_t *rx_pdu) void iscsit_pdu_op_logout_cmd(iscsit_conn_t *ict, idm_pdu_t *rx_pdu) { - iscsi_logout_hdr_t *logout_req = + iscsi_logout_hdr_t *logout_req = (iscsi_logout_hdr_t *)rx_pdu->isp_hdr; iscsi_logout_rsp_hdr_t *logout_rsp; idm_pdu_t *resp; @@ -2712,7 +2712,7 @@ iscsit_send_async_event(iscsit_conn_t *ict, uint8_t event) */ abt = idm_pdu_alloc(sizeof (iscsi_hdr_t), 0); if (abt == NULL) { - idm_conn_event(ict->ict_ic, CE_TRANSPORT_FAIL, NULL); + idm_conn_event(ict->ict_ic, CE_TRANSPORT_FAIL, 0); return; } @@ -2762,7 +2762,7 @@ iscsit_send_reject(iscsit_conn_t *ict, idm_pdu_t *rejected_pdu, uint8_t reason) reject_pdu = idm_pdu_alloc(sizeof (iscsi_hdr_t), rejected_pdu->isp_hdrlen); if (reject_pdu == NULL) { - idm_conn_event(ict->ict_ic, CE_TRANSPORT_FAIL, NULL); + idm_conn_event(ict->ict_ic, CE_TRANSPORT_FAIL, 0); return; } idm_pdu_init(reject_pdu, ict->ict_ic, NULL, NULL); @@ -3188,7 +3188,7 @@ static void iscsit_add_pdu_to_queue(iscsit_sess_t *ist, idm_pdu_t *rx_pdu) { iscsit_cbuf_t *cbuf = ist->ist_rxpdu_queue; - iscsit_conn_t *ict = rx_pdu->isp_ic->ic_handle; + iscsit_conn_t *ict = rx_pdu->isp_ic->ic_handle; uint32_t cmdsn = ((iscsi_scsi_cmd_hdr_t *)rx_pdu->isp_hdr)->cmdsn; uint32_t index; diff --git a/usr/src/uts/common/io/comstar/port/iscsit/iscsit_tgt.c b/usr/src/uts/common/io/comstar/port/iscsit/iscsit_tgt.c index 97a1909ca0..5d551804a8 100644 --- a/usr/src/uts/common/io/comstar/port/iscsit/iscsit_tgt.c +++ b/usr/src/uts/common/io/comstar/port/iscsit/iscsit_tgt.c @@ -1084,7 +1084,7 @@ iscsit_tgt_avl_compare(const void *void_tgt1, const void *void_tgt2) { const iscsit_tgt_t *tgt1 = void_tgt1; const iscsit_tgt_t *tgt2 = void_tgt2; - int result; + int result; /* * Sort by ISID first then TSIH @@ -1132,7 +1132,7 @@ iscsit_portal_t * iscsit_tgt_lookup_portal(iscsit_tgt_t *tgt, struct sockaddr_storage *sa, iscsit_tpgt_t **output_tpgt) { - iscsit_tpgt_t *tpgt; + iscsit_tpgt_t *tpgt; iscsit_portal_t *portal; /* Caller holds tgt->target_mutex */ @@ -1189,7 +1189,7 @@ iscsit_tgt_unbind_sess(iscsit_tgt_t *tgt, iscsit_sess_t *sess) } } -#define LOCK_FOR_SESS_LOOKUP(lookup_tgt) { \ +#define LOCK_FOR_SESS_LOOKUP(lookup_tgt) { \ if ((lookup_tgt) == NULL) { \ ISCSIT_GLOBAL_LOCK(RW_READER); \ } else { \ @@ -1197,11 +1197,11 @@ iscsit_tgt_unbind_sess(iscsit_tgt_t *tgt, iscsit_sess_t *sess) } \ } -#define UNLOCK_FOR_SESS_LOOKUP(lookup_tgt) { \ +#define UNLOCK_FOR_SESS_LOOKUP(lookup_tgt) { \ if ((lookup_tgt) == NULL) { \ ISCSIT_GLOBAL_UNLOCK(); \ - } else { \ - mutex_exit(&(lookup_tgt)->target_mutex); \ + } else { \ + mutex_exit(&(lookup_tgt)->target_mutex); \ } \ } @@ -1224,7 +1224,7 @@ iscsit_tgt_lookup_sess(iscsit_tgt_t *tgt, char *initiator_name, } LOCK_FOR_SESS_LOOKUP(tgt); - if (avl_numnodes(sess_avl) == NULL) { + if (avl_numnodes(sess_avl) == 0) { UNLOCK_FOR_SESS_LOOKUP(tgt); return (NULL); } @@ -1419,7 +1419,7 @@ iscsit_tpgt_avl_compare(const void *void_tpgt1, const void *void_tpgt2) static idm_status_t iscsit_tgt_online(iscsit_tgt_t *tgt) { - iscsit_tpgt_t *tpgt, *tpgt_fail; + iscsit_tpgt_t *tpgt, *tpgt_fail; idm_status_t rc; mutex_enter(&tgt->target_mutex); @@ -1468,7 +1468,7 @@ iscsit_tgt_offline_cb(void *tgt_void) static void iscsit_tgt_offline(iscsit_tgt_t *tgt) { - iscsit_tpgt_t *tpgt; + iscsit_tpgt_t *tpgt; iscsit_sess_t *ist; mutex_enter(&tgt->target_mutex); @@ -1741,7 +1741,7 @@ iscsit_tpg_avl_compare(const void *void_tpg1, const void *void_tpg2) { const iscsit_tpg_t *tpg1 = void_tpg1; const iscsit_tpg_t *tpg2 = void_tpg2; - int result; + int result; /* * Sort by ISID first then TSIH @@ -2077,7 +2077,7 @@ iscsit_ini_avl_compare(const void *void_ini1, const void *void_ini2) { const iscsit_ini_t *ini1 = void_ini1; const iscsit_ini_t *ini2 = void_ini2; - int result; + int result; /* * Sort by ISID first then TSIH |