Re: [PATCH net-next-2.6] net_sched: sch_mqprio: dont leak kernel memory
flat view
From: Eric Dumazet <hidden>
Date: 2011-01-26 20:23:15
Le mercredi 26 janvier 2011 à 11:55 -0800, David Miller a écrit :
From: Joe Perches <joe@perches.com>quoted
I think the best style to use memset so that any possible struct padding is guaranteed to be zeroed.Such padding does not exist, and we won't add such padding since this is a user visible data structure and thus whose layout is cast in stone. Anyways, I'm ambivalent to how this is fixed actually.
I am perfectly aware of this ugly memset() style some people prefer, and
5 % of the time they swap 2nd and 3rd param.
Two patches instead of one ;)
In this particular case, I only used existing codestyle: In the same
file I noticed :
vi +322 net/sched/sch_mqprio.c
static int mqprio_dump_class_stats(struct Qdisc *sch, unsigned long cl,
struct gnet_dump *d)
{
struct net_device *dev = qdisc_dev(sch);
if (cl <= netdev_get_num_tc(dev)) {
int i;
struct Qdisc *qdisc;
struct gnet_stats_queue qstats = {0};
struct gnet_stats_basic_packed bstats = {0};
struct netdev_tc_txq tc = dev->tc_to_txq[cl - 1];