From: Dan Carpenter Date: Wed, 14 Jun 2017 10:29:31 +0000 (+0300) Subject: net/act_pedit: fix an error code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c4f65b09b459c6f0ec27b1a1a65302f7fea5c96f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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: 71d0ed7079df ("net/act_pedit: Support using offset relative to the conventional network headers") Signed-off-by: Dan Carpenter Acked-by: Amir Vadai Signed-off-by: David S. Miller --- diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index 164b5ac094be..7dc5892671c8 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pedit.c @@ -94,8 +94,10 @@ static struct tcf_pedit_key_ex *tcf_pedit_keys_ex_parse(struct nlattr *nla, k++; } - if (n) + if (n) { + err = -EINVAL; goto err_out; + } return keys_ex;