libnvdimm: Hold reference on parent while scheduling async init
authorAlexander Duyck <alexander.h.duyck@linux.intel.com>
Tue, 25 Sep 2018 20:53:02 +0000 (13:53 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:16:55 +0000 (11:16 -0800)
commit3e63a7f25cc85d3d3e174b9b0e3489ebb7eaf4ab
treef781332e5e9e66444e7554a720b30e6beb06cdb2
parentb6b45bc40bd118afacbbbb47f17727ce00c6d7f0
libnvdimm: Hold reference on parent while scheduling async init

commit b6eae0f61db27748606cc00dafcfd1e2c032f0a5 upstream.

Unlike asynchronous initialization in the core we have not yet associated
the device with the parent, and as such the device doesn't hold a reference
to the parent.

In order to resolve that we should be holding a reference on the parent
until the asynchronous initialization has completed.

Cc: <stable@vger.kernel.org>
Fixes: 4d88a97aa9e8 ("libnvdimm: ...base ... infrastructure")
Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvdimm/bus.c