libnvdimm/namespace: Fix a potential NULL pointer dereference
authorKangjie Lu <kjlu@umn.edu>
Tue, 12 Mar 2019 08:20:34 +0000 (03:20 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 May 2019 17:43:40 +0000 (19:43 +0200)
commit93cc83319f9aca32b0d4cd5156086d908287b376
tree0bf362f7352e251e7a237d65eae130eae6df5cca
parentd1a8691fff95cdb100739281854b0afafb8c57df
libnvdimm/namespace: Fix a potential NULL pointer dereference

[ Upstream commit 55c1fc0af29a6c1b92f217b7eb7581a882e0c07c ]

In case kmemdup fails, the fix goes to blk_err to avoid NULL
pointer dereference.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvdimm/namespace_devs.c