The speed_fec_capa pointer can be null. So dereferencing the pointer is
removed and only the pointer is captured in trace function.
Fixed few more trace functions in which null pointer can be dereferenced.

Coverity issue: 383238
Bugzilla ID: 1162
Fixes: 6679cf21d608 ("ethdev: add trace points")
Fixes: ed04fd4072e9 ("ethdev: add trace points for flow")

Signed-off-by: Ankur Dwivedi <adwiv...@marvell.com>
---
 lib/ethdev/ethdev_trace.h | 29 +++++++----------------------
 1 file changed, 7 insertions(+), 22 deletions(-)

diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h
index 53d1a71ff0..a13e33fe64 100644
--- a/lib/ethdev/ethdev_trace.h
+++ b/lib/ethdev/ethdev_trace.h
@@ -123,8 +123,7 @@ RTE_TRACE_POINT(
        RTE_TRACE_POINT_ARGS(uint16_t port_id,
                const struct rte_eth_dev_owner *owner, int ret),
        rte_trace_point_emit_u16(port_id);
-       rte_trace_point_emit_u64(owner->id);
-       rte_trace_point_emit_string(owner->name);
+       rte_trace_point_emit_ptr(owner);
        rte_trace_point_emit_int(ret);
 )
 
@@ -375,9 +374,7 @@ RTE_TRACE_POINT(
        rte_eth_trace_find_next_of,
        RTE_TRACE_POINT_ARGS(uint16_t port_id, const struct rte_device *parent),
        rte_trace_point_emit_u16(port_id);
-       rte_trace_point_emit_string(parent->name);
-       rte_trace_point_emit_string(parent->bus_info);
-       rte_trace_point_emit_int(parent->numa_node);
+       rte_trace_point_emit_ptr(parent);
 )
 
 RTE_TRACE_POINT(
@@ -869,8 +866,7 @@ RTE_TRACE_POINT(
                const struct rte_eth_fec_capa *speed_fec_capa,
                unsigned int num, int ret),
        rte_trace_point_emit_u16(port_id);
-       rte_trace_point_emit_u32(speed_fec_capa->speed);
-       rte_trace_point_emit_u32(speed_fec_capa->capa);
+       rte_trace_point_emit_ptr(speed_fec_capa);
        rte_trace_point_emit_u32(num);
        rte_trace_point_emit_int(ret);
 )
@@ -1416,8 +1412,7 @@ RTE_TRACE_POINT(
                const struct rte_flow_item *pattern,
                const struct rte_flow_action *actions, int ret),
        rte_trace_point_emit_u16(port_id);
-       rte_trace_point_emit_u32(attr->group);
-       rte_trace_point_emit_u32(attr->priority);
+       rte_trace_point_emit_ptr(attr);
        rte_trace_point_emit_ptr(pattern);
        rte_trace_point_emit_ptr(actions);
        rte_trace_point_emit_int(ret);
@@ -1510,10 +1505,7 @@ RTE_TRACE_POINT(
                const struct rte_flow_item_flex_conf *conf,
                const struct rte_flow_item_flex_handle *handle),
        rte_trace_point_emit_u16(port_id);
-       rte_trace_point_emit_int(conf->tunnel);
-       rte_trace_point_emit_int(conf->nb_samples);
-       rte_trace_point_emit_int(conf->nb_inputs);
-       rte_trace_point_emit_int(conf->nb_outputs);
+       rte_trace_point_emit_ptr(conf);
        rte_trace_point_emit_ptr(handle);
 )
 
@@ -2308,8 +2300,7 @@ RTE_TRACE_POINT_FP(
                int ret),
        rte_trace_point_emit_u16(port_id);
        rte_trace_point_emit_ptr(flow);
-       rte_trace_point_emit_int(action->type);
-       rte_trace_point_emit_ptr(action->conf);
+       rte_trace_point_emit_ptr(action);
        rte_trace_point_emit_ptr(data);
        rte_trace_point_emit_int(ret);
 )
@@ -2349,14 +2340,8 @@ RTE_TRACE_POINT_FP(
                const struct rte_flow_indir_action_conf *conf,
                const struct rte_flow_action *action,
                const struct rte_flow_action_handle *handle),
-       uint8_t ingress = conf->ingress;
-       uint8_t egress = conf->egress;
-       uint8_t transfer = conf->transfer;
-
        rte_trace_point_emit_u16(port_id);
-       rte_trace_point_emit_u8(ingress);
-       rte_trace_point_emit_u8(egress);
-       rte_trace_point_emit_u8(transfer);
+       rte_trace_point_emit_ptr(conf);
        rte_trace_point_emit_ptr(action);
        rte_trace_point_emit_ptr(handle);
 )
-- 
2.25.1

Reply via email to