Skip to content

Commit c4f65b0

Browse files
Dan Carpenterdavem330
authored andcommitted
net/act_pedit: fix an error code
I'm reviewing static checker warnings where we do ERR_PTR(0), which is the same as NULL. I'm pretty sure we intended to return ERR_PTR(-EINVAL) here. Sometimes these bugs lead to a NULL dereference but I don't immediately see that problem here. Fixes: 71d0ed7 ("net/act_pedit: Support using offset relative to the conventional network headers") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Amir Vadai <amir@vadai.me> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent db46a0e commit c4f65b0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/sched/act_pedit.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,10 @@ static struct tcf_pedit_key_ex *tcf_pedit_keys_ex_parse(struct nlattr *nla,
9494
k++;
9595
}
9696

97-
if (n)
97+
if (n) {
98+
err = -EINVAL;
9899
goto err_out;
100+
}
99101

100102
return keys_ex;
101103

0 commit comments

Comments
 (0)