CID 550702 (#1 of 1): Dereference null return value (NULL_RETURNS)
7. dereference: Dereferencing a pointer that might be NULL ex_type when calling 
nl_attr_get_u16.

Signed-off-by: Roi Dayan <r...@nvidia.com>
---
 lib/tc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/tc.c b/lib/tc.c
index 0a6bc5ecc0b0..9f2eea4f0780 100644
--- a/lib/tc.c
+++ b/lib/tc.c
@@ -1087,6 +1087,10 @@ nl_parse_act_pedit(struct nlattr *options, struct 
tc_flower *flower)
         }
 
         ex_type = nl_attr_find_nested(nla, TCA_PEDIT_KEY_EX_HTYPE);
+        if (!ex_type) {
+            return EOPNOTSUPP;
+        }
+
         type = nl_attr_get_u16(ex_type);
 
         err = csum_update_flag(flower, type);
-- 
2.38.0

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to