From: Jasvinder Singh Date: Mon, 27 Apr 2020 16:56:49 +0000 (+0100) Subject: examples/ip_pipeline: remove check of null response X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=358eb13389070b34809f478678351ab99f813e5b;p=dpdk.git examples/ip_pipeline: remove check of null response For sending request messages to data plane threads, the caller invokes *_msg_send_recv() functions which never return null response. Thus, removed redundant check on the returned response. Coverity issue: 357750, 357740, 357749, 357758, 357702, 357736 Coverity issue: 357679, 357791, 357738, 357778, 357716, 357705 Coverity issue: 357776, 357753, 357729, 357735, 357773, 357723 Fixes: 32e5d9b154cb ("examples/ip_pipeline: add enable and disable commands") Fixes: 50e73d051806 ("examples/ip_pipeline: add stats read commands") Fixes: 6b1b3c3c9d30 ("examples/ip_pipeline: add port enable and disable commands") Fixes: a3a95b7d58b9 ("examples/ip_pipeline: add table entry commands") Fixes: 3186282f8e12 ("examples/ip_pipeline: add table bulk add command") Fixes: f634e4c5698a ("examples/ip_pipeline: add table entry delete command") Fixes: c64b9121a963 ("examples/ip_pipeline: add table entry stats command") Fixes: 7e11393e40ef ("examples/ip_pipeline: add meter profile commands") Fixes: e92058d604e6 ("examples/ip_pipeline: add meter stats command") Fixes: 2b82ef4861c0 ("examples/ip_pipeline: add DSCP table update command") Fixes: d0d306c7f2a1 ("examples/ip_pipeline: add TTL stats command") Fixes: a3169ee5ec59 ("examples/ip_pipeline: support rule time read") Cc: stable@dpdk.org Signed-off-by: Jasvinder Singh Acked-by: Cristian Dumitrescu --- diff --git a/examples/ip_pipeline/thread.c b/examples/ip_pipeline/thread.c index 272fbbeed1..adb83167cd 100644 --- a/examples/ip_pipeline/thread.c +++ b/examples/ip_pipeline/thread.c @@ -325,8 +325,6 @@ thread_pipeline_enable(uint32_t thread_id, /* Send request and wait for response */ rsp = thread_msg_send_recv(thread_id, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -412,8 +410,6 @@ thread_pipeline_disable(uint32_t thread_id, /* Send request and wait for response */ rsp = thread_msg_send_recv(thread_id, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -815,8 +811,6 @@ pipeline_port_in_stats_read(const char *pipeline_name, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -863,8 +857,6 @@ pipeline_port_in_enable(const char *pipeline_name, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -909,8 +901,6 @@ pipeline_port_in_disable(const char *pipeline_name, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -963,8 +953,6 @@ pipeline_port_out_stats_read(const char *pipeline_name, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -1019,8 +1007,6 @@ pipeline_table_stats_read(const char *pipeline_name, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -1436,10 +1422,6 @@ pipeline_table_rule_add(const char *pipeline_name, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) { - free(rule); - return -1; - } /* Read response */ status = rsp->status; @@ -1538,10 +1520,6 @@ pipeline_table_rule_add_default(const char *pipeline_name, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) { - free(rule); - return -1; - } /* Read response */ status = rsp->status; @@ -1655,10 +1633,6 @@ pipeline_table_rule_add_bulk(const char *pipeline_name, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) { - table_rule_list_free(list); - return -ENOMEM; - } /* Read response */ status = rsp->status; @@ -1733,8 +1707,6 @@ pipeline_table_rule_delete(const char *pipeline_name, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -1790,8 +1762,6 @@ pipeline_table_rule_delete_default(const char *pipeline_name, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -1857,8 +1827,6 @@ pipeline_table_rule_stats_read(const char *pipeline_name, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -1915,8 +1883,6 @@ pipeline_table_mtr_profile_add(const char *pipeline_name, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -1967,8 +1933,6 @@ pipeline_table_mtr_profile_delete(const char *pipeline_name, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -2037,8 +2001,6 @@ pipeline_table_rule_mtr_read(const char *pipeline_name, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -2096,8 +2058,6 @@ pipeline_table_dscp_table_update(const char *pipeline_name, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -2164,8 +2124,6 @@ pipeline_table_rule_ttl_read(const char *pipeline_name, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status; @@ -2229,8 +2187,6 @@ pipeline_table_rule_time_read(const char *pipeline_name, /* Send request and wait for response */ rsp = pipeline_msg_send_recv(p, req); - if (rsp == NULL) - return -1; /* Read response */ status = rsp->status;