Skip to content

Commit

Permalink
net/sched: remove unneeded NULL check
Browse files Browse the repository at this point in the history
There is no need to check "s".  nla_data() doesn't return NULL.  Also we
already dereferenced "s" at this point so it would have oopsed ealier if
it were NULL.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Aug 18, 2010
1 parent 666be42 commit 00093fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sched/sch_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ static struct qdisc_size_table *qdisc_get_stab(struct nlattr *opt)
tsize = nla_len(tb[TCA_STAB_DATA]) / sizeof(u16);
}

if (!s || tsize != s->tsize || (!tab && tsize > 0))
if (tsize != s->tsize || (!tab && tsize > 0))
return ERR_PTR(-EINVAL);

spin_lock(&qdisc_stab_lock);
Expand Down

0 comments on commit 00093fa

Please sign in to comment.