summaryrefslogtreecommitdiffstats
path: root/net/sched/sch_hfsc.c
diff options
context:
space:
mode:
authorZhengchao Shao <shaozhengchao@huawei.com>2022-08-29 15:12:19 +0800
committerPaolo Abeni <pabeni@redhat.com>2022-09-01 08:06:45 +0200
commita102c8973db7f7b7b6f75d51eed145d070438a49 (patch)
treeb79d8ca008bc816a2521cb817529ba4a43591944 /net/sched/sch_hfsc.c
parent0e4d354762cefd3e16b4cff8988ff276e45effc4 (diff)
downloadlinux-a102c8973db7f7b7b6f75d51eed145d070438a49.tar.gz
linux-a102c8973db7f7b7b6f75d51eed145d070438a49.tar.bz2
linux-a102c8973db7f7b7b6f75d51eed145d070438a49.zip
net: sched: remove redundant NULL check in change hook function
Currently, the change function can be called by two ways. The one way is that qdisc_change() will call it. Before calling change function, qdisc_change() ensures tca[TCA_OPTIONS] is not empty. The other way is that .init() will call it. The opt parameter is also checked before calling change function in .init(). Therefore, it's no need to check the input parameter opt in change function. Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> Acked-by: Toke Høiland-Jørgensen <toke@toke.dk> Link: https://lore.kernel.org/r/20220829071219.208646-1-shaozhengchao@huawei.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/sched/sch_hfsc.c')
-rw-r--r--net/sched/sch_hfsc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index 03efc40e42fc..c8bef923c79c 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -1430,7 +1430,7 @@ hfsc_change_qdisc(struct Qdisc *sch, struct nlattr *opt,
struct hfsc_sched *q = qdisc_priv(sch);
struct tc_hfsc_qopt *qopt;
- if (opt == NULL || nla_len(opt) < sizeof(*qopt))
+ if (nla_len(opt) < sizeof(*qopt))
return -EINVAL;
qopt = nla_data(opt);