From a102c8973db7f7b7b6f75d51eed145d070438a49 Mon Sep 17 00:00:00 2001 From: Zhengchao Shao Date: Mon, 29 Aug 2022 15:12:19 +0800 Subject: net: sched: remove redundant NULL check in change hook function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/r/20220829071219.208646-1-shaozhengchao@huawei.com Signed-off-by: Paolo Abeni --- net/sched/sch_netem.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'net/sched/sch_netem.c') diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index 5449ed114e40..b70ac04110dd 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c @@ -961,9 +961,6 @@ static int netem_change(struct Qdisc *sch, struct nlattr *opt, int old_loss_model = CLG_RANDOM; int ret; - if (opt == NULL) - return -EINVAL; - qopt = nla_data(opt); ret = parse_attr(tb, TCA_NETEM_MAX, opt, netem_policy, sizeof(*qopt)); if (ret < 0) -- cgit v1.2.3