netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net_sched: drr: check for NULL pointer in drr_dequeue
@ 2016-01-26  3:51 Bernie Harris
  2016-01-26 18:03 ` Cong Wang
  0 siblings, 1 reply; 7+ messages in thread
From: Bernie Harris @ 2016-01-26  3:51 UTC (permalink / raw)
  To: netdev; +Cc: davem, jhs, stable, bernie.harris

There are cases where qdisc_dequeue_peeked can return NULL, and the result
is dereferenced later on in the function.

Similarly to the other qdisc dequeue functions, check whether the skb
pointer is NULL and if it is, goto out.

Signed-off-by: Bernie Harris <bernie.harris@alliedtelesis.co.nz>
---
 net/sched/sch_drr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/sched/sch_drr.c b/net/sched/sch_drr.c
index f26bdea..8086c3d 100644
--- a/net/sched/sch_drr.c
+++ b/net/sched/sch_drr.c
@@ -403,6 +403,8 @@ static struct sk_buff *drr_dequeue(struct Qdisc *sch)
 		if (len <= cl->deficit) {
 			cl->deficit -= len;
 			skb = qdisc_dequeue_peeked(cl->qdisc);
+			if (skb == NULL)
+				goto out;
 			if (cl->qdisc->q.qlen == 0)
 				list_del(&cl->alist);
 
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-01-30  1:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-26  3:51 [PATCH] net_sched: drr: check for NULL pointer in drr_dequeue Bernie Harris
2016-01-26 18:03 ` Cong Wang
2016-01-28  3:26   ` Bernie Harris
2016-01-28  3:30   ` Bernie Harris
2016-01-28 14:04     ` Sergei Shtylyov
2016-01-29 18:19     ` Cong Wang
2016-01-30  1:27     ` 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).