net/sched: remove unneeded NULL check
Subsystems (4)
PATCH 1/1 net/sched: remove unneeded NULL check
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 <[email protected]>
net/sched/sch_api.c +1 -1
@@ -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);
Quoted 3 lines · Dan Carpenter
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.
Looks OK to me.
Jarek P.
Quoted 17 lines
Signed-off-by Dan Carpenter <[email protected]>net/sched/sch_api.c +1
-2@@ -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); --
From: Dan Carpenter <[email protected]>
Date: Sat, 14 Aug 2010 23:09:49 +0200
Quoted 5 lines
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 <[email protected]>
Applied.