summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRoi Dayan <roid@nvidia.com>2022-11-04 15:06:04 +0200
committerSimon Horman <simon.horman@corigine.com>2022-11-07 05:41:40 -0500
commit6ccf8efffccbacd1d7caacbde37f6999a66b3867 (patch)
treec850342bf3993f421674b5e4b7671d2f0804847e /lib
parentd77f93f363b7bb68186b432f579855b8a837d64e (diff)
downloadopenvswitch-6ccf8efffccbacd1d7caacbde37f6999a66b3867.tar.gz
tc: Fix coverity dereference null return value
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 <roid@nvidia.com> Signed-off-by: Simon Horman <simon.horman@corigine.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/tc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/tc.c b/lib/tc.c
index b9a013845..a66dc432f 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);