From 6d4339e4a412a0957024db837cf49cf080d51ea1 Mon Sep 17 00:00:00 2001 From: shantonu Date: Tue, 23 Jun 2015 12:53:03 -0700 Subject: [PATCH 1/2] prov/sockets: Coverity scan fix Signed-off-by: Shantonu Hossain --- prov/sockets/src/sock_progress.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/prov/sockets/src/sock_progress.c b/prov/sockets/src/sock_progress.c index 4bd68986133..64bf37ab6a4 100644 --- a/prov/sockets/src/sock_progress.c +++ b/prov/sockets/src/sock_progress.c @@ -1403,10 +1403,10 @@ static int sock_pe_process_rx_send(struct sock_pe *pe, struct sock_rx_ctx *rx_ct return 0; len += SOCK_CQ_DATA_SIZE; } - + if (pe_entry->done_len == len && !pe_entry->pe.rx.rx_entry) { data_len = pe_entry->msg_hdr.msg_len - len; - + fastlock_acquire(&rx_ctx->lock); sock_pe_progress_buffered_rx(rx_ctx); @@ -2464,6 +2464,11 @@ static void sock_thread_set_affinity(char *s) int j, first, last,stride; cpu_set_t mycpuset; pthread_t mythread; + + if(!s) { + SOCK_LOG_DBG("Invalid FI_SOCKETS_PE_AFFINITY value\n"); + return; + } mythread = pthread_self(); CPU_ZERO(&mycpuset); From 97c91f1cacc0e6d18deb613fa266320910a6df7d Mon Sep 17 00:00:00 2001 From: shantonu Date: Tue, 23 Jun 2015 15:08:21 -0700 Subject: [PATCH 2/2] prov/sockets: Removed redundant handling of pe_entry attributes Signed-off-by: Shantonu Hossain --- prov/sockets/src/sock_progress.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/prov/sockets/src/sock_progress.c b/prov/sockets/src/sock_progress.c index 64bf37ab6a4..1b8437b4ca4 100644 --- a/prov/sockets/src/sock_progress.c +++ b/prov/sockets/src/sock_progress.c @@ -1404,9 +1404,9 @@ static int sock_pe_process_rx_send(struct sock_pe *pe, struct sock_rx_ctx *rx_ct len += SOCK_CQ_DATA_SIZE; } - if (pe_entry->done_len == len && !pe_entry->pe.rx.rx_entry) { - data_len = pe_entry->msg_hdr.msg_len - len; - + data_len = pe_entry->msg_hdr.msg_len - len; + + if (pe_entry->done_len == len && !pe_entry->pe.rx.rx_entry) { fastlock_acquire(&rx_ctx->lock); sock_pe_progress_buffered_rx(rx_ctx); @@ -1429,7 +1429,6 @@ static int sock_pe_process_rx_send(struct sock_pe *pe, struct sock_rx_ctx *rx_ct rx_entry->data = pe_entry->data; rx_entry->ignore = 0; rx_entry->comp = pe_entry->comp; - pe_entry->context = rx_entry->context; if (pe_entry->msg_hdr.flags & FI_REMOTE_CQ_DATA) rx_entry->flags |= FI_REMOTE_CQ_DATA; @@ -1445,7 +1444,7 @@ static int sock_pe_process_rx_send(struct sock_pe *pe, struct sock_rx_ctx *rx_ct rx_entry = pe_entry->pe.rx.rx_entry; done_data = pe_entry->done_len - len; - pe_entry->data_len = pe_entry->msg_hdr.msg_len - len; + pe_entry->data_len = data_len; rem = pe_entry->data_len - done_data; used = rx_entry->used;