devm_memremap: Fix error value when memremap failed
authorToshi Kani <toshi.kani@hpe.com>
Sat, 20 Feb 2016 22:32:24 +0000 (14:32 -0800)
committerDan Williams <dan.j.williams@intel.com>
Wed, 24 Feb 2016 01:17:20 +0000 (17:17 -0800)
commit93f834df9c2d4e362dfdc4b05daa0a4e18814836
tree3f17712ac8c9e41baa072484c73032c2596ba228
parent4577b0665515e0abc7bc72562d6328d179598815
devm_memremap: Fix error value when memremap failed

devm_memremap() returns an ERR_PTR() value in case of error.
However, it returns NULL when memremap() failed.  This causes
the caller, such as the pmem driver, to proceed and oops later.

Change devm_memremap() to return ERR_PTR(-ENXIO) when memremap()
failed.

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: <stable@vger.kernel.org>
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
kernel/memremap.c