Re: [PATCH linux 2/2] net sched actions: fix refcount decrement on error

2017-04-17 Thread Cong Wang
On Sat, Apr 15, 2017 at 11:48 AM, Wolfgang Bumiller wrote: > >> On April 15, 2017 at 8:20 PM Cong Wang wrote: >> >> >> On Fri, Apr 14, 2017 at 2:08 AM, Wolfgang Bumiller >> wrote: >> > Before I do that - trying to wrap my head around the interdependencies >> > here better to be thorough - I noti

Re: [PATCH linux 2/2] net sched actions: fix refcount decrement on error

2017-04-16 Thread Jamal Hadi Salim
Wolfgang, can you _please_ stop cc-ing lkml? Everybody you need to deal with is on netdev. On 17-04-15 02:48 PM, Wolfgang Bumiller wrote: So I'm not sure exactly how the module and tc_action counts are related (and I usually like to understand my own patches ;-) ). Every time we add

Re: [PATCH linux 2/2] net sched actions: fix refcount decrement on error

2017-04-15 Thread Wolfgang Bumiller
> On April 15, 2017 at 8:20 PM Cong Wang wrote: > > > On Fri, Apr 14, 2017 at 2:08 AM, Wolfgang Bumiller > wrote: > > Before I do that - trying to wrap my head around the interdependencies > > here better to be thorough - I noticed that tcf_hash_release() can > > return ACT_P_DELETED. The ACT_

Re: [PATCH linux 2/2] net sched actions: fix refcount decrement on error

2017-04-15 Thread Cong Wang
On Fri, Apr 14, 2017 at 2:08 AM, Wolfgang Bumiller wrote: > Before I do that - trying to wrap my head around the interdependencies > here better to be thorough - I noticed that tcf_hash_release() can > return ACT_P_DELETED. The ACT_P_CREATED case means tcf_hash_create() > was used, in the other ca

Re: [PATCH linux 2/2] net sched actions: fix refcount decrement on error

2017-04-14 Thread Wolfgang Bumiller
On Thu, Apr 13, 2017 at 11:03:37AM -0700, Cong Wang wrote: > On Thu, Apr 13, 2017 at 1:06 AM, Wolfgang Bumiller > wrote: > > On Wed, Apr 12, 2017 at 09:27:31PM -0700, Cong Wang wrote: > >> Instead of duplicating code, you can add the check > >> to the module_put() next to err_mod label? I mean: >

Re: [PATCH linux 2/2] net sched actions: fix refcount decrement on error

2017-04-13 Thread Cong Wang
On Thu, Apr 13, 2017 at 1:06 AM, Wolfgang Bumiller wrote: > On Wed, Apr 12, 2017 at 09:27:31PM -0700, Cong Wang wrote: >> Instead of duplicating code, you can add the check >> to the module_put() next to err_mod label? I mean: > > I just realized that with module_put() happening in both error and

Re: [PATCH linux 2/2] net sched actions: fix refcount decrement on error

2017-04-13 Thread Roman Mashak
Wolfgang Bumiller writes: > If memory allocation for nla_memdup_cookie() fails > module_put has to be guarded by the same condition as it was > before the TCA_ACT_COOKIE has been added as stated in the > comment afterwards: > What if a new entry has been created, and a_o->init returns ACT_P_CREA

Re: [PATCH linux 2/2] net sched actions: fix refcount decrement on error

2017-04-13 Thread Wolfgang Bumiller
On Wed, Apr 12, 2017 at 09:27:31PM -0700, Cong Wang wrote: > On Wed, Apr 12, 2017 at 7:21 AM, Wolfgang Bumiller > wrote: > > If memory allocation for nla_memdup_cookie() fails > > module_put has to be guarded by the same condition as it was > > before the TCA_ACT_COOKIE has been added as stated in

Re: [PATCH linux 2/2] net sched actions: fix refcount decrement on error

2017-04-12 Thread Cong Wang
On Wed, Apr 12, 2017 at 7:21 AM, Wolfgang Bumiller wrote: > If memory allocation for nla_memdup_cookie() fails > module_put has to be guarded by the same condition as it was > before the TCA_ACT_COOKIE has been added as stated in the > comment afterwards: > > /* module count goes up only when bran

[PATCH linux 2/2] net sched actions: fix refcount decrement on error

2017-04-12 Thread Wolfgang Bumiller
If memory allocation for nla_memdup_cookie() fails module_put has to be guarded by the same condition as it was before the TCA_ACT_COOKIE has been added as stated in the comment afterwards: /* module count goes up only when brand new policy is created * if it exists and is only bound to in a_o->i