[PATCH 4.12 20/65] nfs/flexfiles: fix leak of nfs4_ff_ds_version arrays

From: Greg Kroah-Hartman
Date: Mon Aug 14 2017 - 21:34:12 EST


4.12-stable review patch. If anyone has any objections, please let me know.

------------------

From: Weston Andros Adamson <dros@xxxxxxxxxx>

commit 1feb26162bee7b2f110facfec71b5c7bdbc7d14d upstream.

The client was freeing the nfs4_ff_layout_ds, but not the contained
nfs4_ff_ds_version array.

Signed-off-by: Weston Andros Adamson <dros@xxxxxxxxxxxxxxx>
Signed-off-by: Anna Schumaker <Anna.Schumaker@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
fs/nfs/flexfilelayout/flexfilelayoutdev.c | 1 +
1 file changed, 1 insertion(+)

--- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c
+++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c
@@ -32,6 +32,7 @@ void nfs4_ff_layout_free_deviceid(struct
{
nfs4_print_deviceid(&mirror_ds->id_node.deviceid);
nfs4_pnfs_ds_put(mirror_ds->ds);
+ kfree(mirror_ds->ds_versions);
kfree_rcu(mirror_ds, id_node.rcu);
}