From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick McHardy Subject: Re: [PATCH][NET_SCHED] sch_prio: class statistics printing enabled Date: Wed, 31 Jan 2007 15:37:25 +0100 Message-ID: <45C0A9A5.4080607@trash.net> References: <20070131075348.GA1857@ff.dom.local> <45C09E0B.6020107@trash.net> <20070131143522.GB3521@ff.dom.local> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: Jarek Poplawski Return-path: Received: from stinky.trash.net ([213.144.137.162]:63523 "EHLO stinky.trash.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933306AbXAaOh1 (ORCPT ); Wed, 31 Jan 2007 09:37:27 -0500 In-Reply-To: <20070131143522.GB3521@ff.dom.local> Sender: netdev-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Jarek Poplawski wrote: > +static int prio_dump_class_stats(struct Qdisc *sch, unsigned long cl, > + struct gnet_dump *d) > +{ > + struct prio_sched_data *q = qdisc_priv(sch); > + struct Qdisc *cl_q; > + > + if (cl - 1 > q->bands) > + return -1; Thats not what I meant, it still hides the bug. Either do nothing (don't check) or do BUG_ON(cl - 1 > q->bands).