nfs: plug memory leak when ->prepare_layoutcommit fails
authorJeff Layton <jlayton@poochiereds.net>
Fri, 10 Jul 2015 19:58:42 +0000 (15:58 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 28 Jul 2015 13:07:02 +0000 (09:07 -0400)
commit3471648a7569512e10f154cdfe5076c341a5c099
treeebd3e8c3ddfa687b9d1e4c703440f4bcf2d3058a
parentf580dd042823294b5b548e0f8bf1ba7a4b114fa5
nfs: plug memory leak when ->prepare_layoutcommit fails

"data" is currently leaked when the prepare_layoutcommit operation
returns an error. Put the cred before taking the spinlock in that
case, take the lock and then goto out_unlock which will drop the
lock and then free "data".

Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/pnfs.c