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:41:19 +0000 (19:41 +0200)
commite94f852e2034b6b64f1c4694cc72d3b5274d988d
treeebc44586705edebcb20850e11ffb2887b5e72a0e
parent5f72e3a021a6392a4988b167e25b859c26bf55df
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