Re: [PATCH] nfsd: fix memory leak of async_copy

2018-07-17 Thread J . Bruce Fields
Cc'ing Olga.--b. On Tue, Jul 17, 2018 at 10:33:59AM +0100, Colin Ian King wrote: > On 17/07/18 10:30, Dan Carpenter wrote: > > On Mon, Jul 16, 2018 at 01:09:54PM +0100, Colin King wrote: > >> From: Colin Ian King > >> > >> In the case where async_copy is successfully allocated but > >> the call t

Re: [PATCH] nfsd: fix memory leak of async_copy

2018-07-17 Thread Colin Ian King
On 17/07/18 10:30, Dan Carpenter wrote: > On Mon, Jul 16, 2018 at 01:09:54PM +0100, Colin King wrote: >> From: Colin Ian King >> >> In the case where async_copy is successfully allocated but >> the call to nfs4_init_cp_state fails, async_copy is not >> currently freed and the memory is leaked. Fix

Re: [PATCH] nfsd: fix memory leak of async_copy

2018-07-17 Thread Dan Carpenter
On Mon, Jul 16, 2018 at 01:09:54PM +0100, Colin King wrote: > From: Colin Ian King > > In the case where async_copy is successfully allocated but > the call to nfs4_init_cp_state fails, async_copy is not > currently freed and the memory is leaked. Fix this by kfree'ing > it before returning. > >

[PATCH] nfsd: fix memory leak of async_copy

2018-07-16 Thread Colin King
From: Colin Ian King In the case where async_copy is successfully allocated but the call to nfs4_init_cp_state fails, async_copy is not currently freed and the memory is leaked. Fix this by kfree'ing it before returning. Detected by CoverityScan, CID#1471823 ("Resource leak") Fixes: beb1814d5a8