From 6ccf8efffccbacd1d7caacbde37f6999a66b3867 Mon Sep 17 00:00:00 2001 From: Roi Dayan Date: Fri, 4 Nov 2022 15:06:04 +0200 Subject: 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 Signed-off-by: Simon Horman --- lib/tc.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') 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); -- cgit v1.2.1