diff options
author | Toomas Soome <tsoome@me.com> | 2019-01-20 15:13:45 +0200 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2019-04-24 09:41:18 +0300 |
commit | 03b18ed2fedba1f49023f25d34cbb6e4d0d8f435 (patch) | |
tree | d532bacee867512d9e3838080880d2e4f0a5f501 | |
parent | 28ec64d9ac03d17ce922c30274d804b981cda66e (diff) | |
download | illumos-joyent-03b18ed2fedba1f49023f25d34cbb6e4d0d8f435.tar.gz |
10771 ibmf: NULL pointer errors
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r-- | usr/src/uts/common/io/ib/mgt/ibmf/ibmf_saa_utils.c | 8 | ||||
-rw-r--r-- | usr/src/uts/common/io/ib/mgt/ibmf/ibmf_wqe.c | 20 |
2 files changed, 13 insertions, 15 deletions
diff --git a/usr/src/uts/common/io/ib/mgt/ibmf/ibmf_saa_utils.c b/usr/src/uts/common/io/ib/mgt/ibmf/ibmf_saa_utils.c index 4c76719724..034ce8a881 100644 --- a/usr/src/uts/common/io/ib/mgt/ibmf/ibmf_saa_utils.c +++ b/usr/src/uts/common/io/ib/mgt/ibmf/ibmf_saa_utils.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <sys/kmem.h> #include <sys/sunddi.h> @@ -485,7 +483,7 @@ static void ibmf_saa_multipath_record_parse_buffer(uchar_t *buffer, uint16_t num_gids; sa_multipath_record_t *multipath_record = - (sa_multipath_record_t *)record; + (sa_multipath_record_t *)record; ibmf_utils_unpack_data("l2c2s14c", buffer, IBMF_SAA_MULTIPATH_RECORD_SIZE, multipath_record, @@ -871,7 +869,7 @@ static void ibmf_saa_multipath_record_to_buf(void *record, uchar_t *buffer) char gid_str[20]; uint16_t num_gids; sa_multipath_record_t *multipath_record = - (sa_multipath_record_t *)record; + (sa_multipath_record_t *)record; num_gids = multipath_record->SGIDCount + multipath_record->DGIDCount; @@ -974,7 +972,7 @@ ibmf_saa_utils_pack_payload(uchar_t *structs_payload, size_t if (structs_payload_length == 0) { - *buf_payload_lengthp = NULL; + *buf_payload_lengthp = 0; *buf_payloadp = NULL; return (IBMF_SUCCESS); diff --git a/usr/src/uts/common/io/ib/mgt/ibmf/ibmf_wqe.c b/usr/src/uts/common/io/ib/mgt/ibmf/ibmf_wqe.c index 9d0ec7b387..67a3092f24 100644 --- a/usr/src/uts/common/io/ib/mgt/ibmf/ibmf_wqe.c +++ b/usr/src/uts/common/io/ib/mgt/ibmf/ibmf_wqe.c @@ -87,7 +87,7 @@ ibmf_send_wqe_cache_constructor(void *buf, void *cdrarg, int kmflags) send_wqe->send_sg_mem = (ib_vaddr_t)(uintptr_t)vmem_alloc(cip->ci_wqe_ib_vmem, IBMF_MEM_PER_WQE, kmflags == KM_SLEEP ? VM_SLEEP : VM_NOSLEEP); - if (send_wqe->send_sg_mem == NULL) { + if (send_wqe->send_sg_mem == 0) { IBMF_TRACE_1(IBMF_TNF_NODEBUG, DPRINT_L1, ibmf_send_wqe_cache_constructor_err, IBMF_TNF_ERROR, "", "ibmf_send_wqe_cache_constructor(): %s\n", tnf_string, msg, @@ -193,13 +193,13 @@ ibmf_recv_wqe_cache_constructor(void *buf, void *cdrarg, int kmflags) "ibmf_recv_wqe_cache_constructor() enter, buf = %p, cdarg = %p\n", tnf_opaque, buf, buf, tnf_opaque, cdrarg, cdrarg); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*recv_wqe)) + _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*recv_wqe)) /* initialize recv WQE context */ recv_wqe->recv_sg_mem = (ib_vaddr_t)(uintptr_t)vmem_alloc(cip->ci_wqe_ib_vmem, IBMF_MEM_PER_WQE, kmflags == KM_SLEEP ? VM_SLEEP : VM_NOSLEEP); - if (recv_wqe->recv_sg_mem == NULL) { + if (recv_wqe->recv_sg_mem == 0) { IBMF_TRACE_1(IBMF_TNF_NODEBUG, DPRINT_L1, ibmf_recv_wqe_cache_constructor_err, IBMF_TNF_ERROR, "", "ibmf_recv_wqe_cache_constructor(): %s\n", tnf_string, msg, @@ -277,7 +277,7 @@ ibmf_recv_wqe_cache_destructor(void *buf, void *cdrarg) "ibmf_recv_wqe_cache_destructor() enter, buf = %p, cdarg = %p\n", tnf_opaque, buf, buf, tnf_opaque, cdrarg, cdrarg); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*recv_wqe)) + _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*recv_wqe)) /* Free the vmem allocated for the WQE */ vmem_free(cip->ci_wqe_ib_vmem, @@ -306,13 +306,13 @@ ibmf_altqp_send_wqe_cache_constructor(void *buf, void *cdrarg, int kmflags) "ibmf_altqp_send_wqe_cache_constructor() enter, buf = %p, " "cdarg = %p\n", tnf_opaque, buf, buf, tnf_opaque, cdrarg, cdrarg); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*send_wqe)) + _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*send_wqe)) /* initialize send WQE context */ send_wqe->send_sg_mem = (ib_vaddr_t)(uintptr_t)vmem_alloc( qp_ctx->isq_wqe_ib_vmem, IBMF_MEM_PER_WQE, kmflags == KM_SLEEP ? VM_SLEEP : VM_NOSLEEP); - if (send_wqe->send_sg_mem == NULL) { + if (send_wqe->send_sg_mem == 0) { IBMF_TRACE_1(IBMF_TNF_NODEBUG, DPRINT_L1, ibmf_altqp_send_wqe_cache_constructor_err, IBMF_TNF_ERROR, "", "ibmf_altqp_send_wqe_cache_constructor(): %s\n", @@ -390,7 +390,7 @@ ibmf_altqp_send_wqe_cache_destructor(void *buf, void *cdrarg) "ibmf_altqp_send_wqe_cache_destructor() enter, buf = %p, " "cdarg = %p\n", tnf_opaque, buf, buf, tnf_opaque, cdrarg, cdrarg); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*send_wqe)) + _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*send_wqe)) /* Free the vmem allocated for the WQE */ vmem_free(qp_ctx->isq_wqe_ib_vmem, @@ -419,13 +419,13 @@ ibmf_altqp_recv_wqe_cache_constructor(void *buf, void *cdrarg, int kmflags) "ibmf_altqp_recv_wqe_cache_constructor() enter, buf = %p, " "cdarg = %p\n", tnf_opaque, buf, buf, tnf_opaque, cdrarg, cdrarg); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*recv_wqe)) + _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*recv_wqe)) /* initialize recv WQE context */ recv_wqe->recv_sg_mem = (ib_vaddr_t)(uintptr_t)vmem_alloc( qp_ctx->isq_wqe_ib_vmem, IBMF_MEM_PER_WQE, kmflags == KM_SLEEP ? VM_SLEEP : VM_NOSLEEP); - if (recv_wqe->recv_sg_mem == NULL) { + if (recv_wqe->recv_sg_mem == 0) { IBMF_TRACE_1(IBMF_TNF_NODEBUG, DPRINT_L1, ibmf_altqp_recv_wqe_cache_constructor_err, IBMF_TNF_ERROR, "", "ibmf_altqp_recv_wqe_cache_constructor(): %s\n", @@ -502,7 +502,7 @@ ibmf_altqp_recv_wqe_cache_destructor(void *buf, void *cdrarg) "ibmf_altqp_recv_wqe_cache_destructor() enter, buf = %p, " "cdarg = %p\n", tnf_opaque, buf, buf, tnf_opaque, cdrarg, cdrarg); - _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*recv_wqe)) + _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*recv_wqe)) /* Free the vmem allocated for the WQE */ vmem_free(qp_ctx->isq_wqe_ib_vmem, |