[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <529D7582.7010108@huawei.com>
Date: Tue, 3 Dec 2013 14:09:06 +0800
From: Yang Yingliang <yangyingliang@...wei.com>
To: Eric Dumazet <eric.dumazet@...il.com>
CC: <davem@...emloft.net>, <netdev@...r.kernel.org>,
<brouer@...hat.com>, <jpirko@...hat.com>, <jbrouer@...hat.com>
Subject: Re: [PATCH net v4 1/2] net: sched: tbf: fix calculation of max_size
On 2013/12/3 12:51, Eric Dumazet wrote:
> On Tue, 2013-12-03 at 11:26 +0800, Yang Yingliang wrote:
>
>> + if (qopt->rate.linklayer == TC_LINKLAYER_UNAWARE) {
>> + rtab = qdisc_get_rtab(&qopt->rate, tb[TCA_TBF_RTAB]);
>> + if (rtab) {
>> + qdisc_put_rtab(rtab);
>> + rtab = NULL;
>> + }
>> }
>
> Please make remove rtab use to make sure you dont leak a pointer.
>
> if (qopt->rate.linklayer == TC_LINKLAYER_UNAWARE)
> qdisc_put_rtab(qdisc_get_rtab(&qopt->rate,
> tb[TCA_TBF_RTAB]));
>
>
>> + if (qopt->peakrate.linklayer == TC_LINKLAYER_UNAWARE) {
>> + ptab = qdisc_get_rtab(&qopt->peakrate, tb[TCA_TBF_PTAB]);
>> + if (ptab) {
>> + qdisc_put_rtab(ptab);
>> + ptab = NULL;
>> + }
>
> Same here for ptab
>
OK, Thanks!
Regards,
Yang
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists