libnvdimm, namespace: fix pmem namespace leak, delete when size set to zero
authorDan Williams <dan.j.williams@intel.com>
Tue, 10 Jan 2017 01:30:49 +0000 (17:30 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Jan 2017 07:24:37 +0000 (08:24 +0100)
commit3c4d83a1a41efdf2c191d0072e6545e6bf8ecc94
treed5493965e47a900af1307a9be50fc9bf76c6849d
parentf29f3616b9328e17f902f1839634b2440ca07982
libnvdimm, namespace: fix pmem namespace leak, delete when size set to zero

commit 1f19b983a8877f81763fab3e693c6befe212736d upstream.

Commit 98a29c39dc68 ("libnvdimm, namespace: allow creation of multiple
pmem-namespaces per region") added support for establishing additional
pmem namespace beyond the seed device, similar to blk namespaces.
However, it neglected to delete the namespace when the size is set to
zero.

Fixes: 98a29c39dc68 ("libnvdimm, namespace: allow creation of multiple pmem-namespaces per region")
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvdimm/namespace_devs.c