* [PATCH net-next 0/2] net_sched: remove unnecessary null pointer check
@ 2013-12-17 7:29 Yang Yingliang
2013-12-17 7:29 ` [PATCH net-next 1/2] act_police: " Yang Yingliang
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Yang Yingliang @ 2013-12-17 7:29 UTC (permalink / raw)
To: davem, netdev
Remove unnecessary null pointer check outside of qdisc_put_rtab().
Yang Yingliang (2):
act_police: remove unnecessary null pointer check
sch_cbq: remove unnecessary null pointer check
net/sched/act_police.c | 6 ++----
net/sched/sch_cbq.c | 3 +--
2 files changed, 3 insertions(+), 6 deletions(-)
--
1.8.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next 1/2] act_police: remove unnecessary null pointer check
2013-12-17 7:29 [PATCH net-next 0/2] net_sched: remove unnecessary null pointer check Yang Yingliang
@ 2013-12-17 7:29 ` Yang Yingliang
2013-12-17 7:29 ` [PATCH net-next 2/2] sch_cbq: " Yang Yingliang
2013-12-19 20:07 ` [PATCH net-next 0/2] net_sched: " David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Yang Yingliang @ 2013-12-17 7:29 UTC (permalink / raw)
To: davem, netdev
It already has a NULL pointer check of rtab in qdisc_put_rtab().
Remove the check outside of qdisc_put_rtab().
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
net/sched/act_police.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index 16a62c3..cf01c97 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -277,10 +277,8 @@ override:
failure_unlock:
spin_unlock_bh(&police->tcf_lock);
failure:
- if (P_tab)
- qdisc_put_rtab(P_tab);
- if (R_tab)
- qdisc_put_rtab(R_tab);
+ qdisc_put_rtab(P_tab);
+ qdisc_put_rtab(R_tab);
if (ret == ACT_P_CREATED)
kfree(police);
return err;
--
1.8.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net-next 2/2] sch_cbq: remove unnecessary null pointer check
2013-12-17 7:29 [PATCH net-next 0/2] net_sched: remove unnecessary null pointer check Yang Yingliang
2013-12-17 7:29 ` [PATCH net-next 1/2] act_police: " Yang Yingliang
@ 2013-12-17 7:29 ` Yang Yingliang
2013-12-19 20:07 ` [PATCH net-next 0/2] net_sched: " David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Yang Yingliang @ 2013-12-17 7:29 UTC (permalink / raw)
To: davem, netdev
It already has a NULL pointer check of rtab in qdisc_put_rtab().
Remove the check outside of qdisc_put_rtab().
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
net/sched/sch_cbq.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index d5a8a4b..e251833 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -1783,8 +1783,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t
qdisc_root_sleeping_lock(sch),
tca[TCA_RATE]);
if (err) {
- if (rtab)
- qdisc_put_rtab(rtab);
+ qdisc_put_rtab(rtab);
return err;
}
}
--
1.8.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next 0/2] net_sched: remove unnecessary null pointer check
2013-12-17 7:29 [PATCH net-next 0/2] net_sched: remove unnecessary null pointer check Yang Yingliang
2013-12-17 7:29 ` [PATCH net-next 1/2] act_police: " Yang Yingliang
2013-12-17 7:29 ` [PATCH net-next 2/2] sch_cbq: " Yang Yingliang
@ 2013-12-19 20:07 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-12-19 20:07 UTC (permalink / raw)
To: yangyingliang; +Cc: netdev
From: Yang Yingliang <yangyingliang@huawei.com>
Date: Tue, 17 Dec 2013 15:29:15 +0800
> Remove unnecessary null pointer check outside of qdisc_put_rtab().
Series applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-12-19 20:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-17 7:29 [PATCH net-next 0/2] net_sched: remove unnecessary null pointer check Yang Yingliang
2013-12-17 7:29 ` [PATCH net-next 1/2] act_police: " Yang Yingliang
2013-12-17 7:29 ` [PATCH net-next 2/2] sch_cbq: " Yang Yingliang
2013-12-19 20:07 ` [PATCH net-next 0/2] net_sched: " David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).