Re: [PATCH net] net/sched: act_pedit: fix memory leak when IDR allocation fails

2018-11-16 Thread David Miller
From: Davide Caratti Date: Wed, 14 Nov 2018 12:17:25 +0100 > tcf_idr_check_alloc() can return a negative value, on allocation failures > (-ENOMEM) or IDR exhaustion (-ENOSPC): don't leak keys_ex in these cases. > > Fixes: 0190c1d452a9 ("net: sched: atomically check-allocate action") >

Re: [PATCH net] net/sched: act_pedit: fix memory leak when IDR allocation fails

2018-11-14 Thread Cong Wang
(Cc'ing Jamal) On Wed, Nov 14, 2018 at 3:26 AM Davide Caratti wrote: > > tcf_idr_check_alloc() can return a negative value, on allocation failures > (-ENOMEM) or IDR exhaustion (-ENOSPC): don't leak keys_ex in these cases. I think the comments above tcf_idr_check_alloc() need to improve too,

[PATCH net] net/sched: act_pedit: fix memory leak when IDR allocation fails

2018-11-14 Thread Davide Caratti
tcf_idr_check_alloc() can return a negative value, on allocation failures (-ENOMEM) or IDR exhaustion (-ENOSPC): don't leak keys_ex in these cases. Fixes: 0190c1d452a9 ("net: sched: atomically check-allocate action") Signed-off-by: Davide Caratti --- net/sched/act_pedit.c | 3 ++- 1 file