Skip to content

Commit

Permalink
[PKT_SCHED]: Fix datalen check in tcf_simp_init().
Browse files Browse the repository at this point in the history
datalen is unsigned so it can never be less than zero,
but that's ok because the attribute passed to nla_len()
has been validated and therefore a negative return
value is impossible.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Apr 18, 2008
1 parent 5308377 commit f5ba2d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sched/act_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ static int tcf_simp_init(struct nlattr *nla, struct nlattr *est,
return -EINVAL;

datalen = nla_len(tb[TCA_DEF_DATA]);
if (datalen <= 0)
if (datalen == 0)
return -EINVAL;

pc = tcf_hash_check(parm->index, a, bind, &simp_hash_info);
Expand Down

0 comments on commit f5ba2d3

Please sign in to comment.