stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "devm_memremap: Fix error value when memremap failed" has been added to the 4.4-stable tree
@ 2016-03-01  5:23 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-03-01  5:23 UTC (permalink / raw)
  To: toshi.kani, akpm, dan.j.williams, gregkh, ross.zwisler
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    devm_memremap: Fix error value when memremap failed

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     devm_memremap-fix-error-value-when-memremap-failed.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 93f834df9c2d4e362dfdc4b05daa0a4e18814836 Mon Sep 17 00:00:00 2001
From: Toshi Kani <toshi.kani@hpe.com>
Date: Sat, 20 Feb 2016 14:32:24 -0800
Subject: devm_memremap: Fix error value when memremap failed

From: Toshi Kani <toshi.kani@hpe.com>

commit 93f834df9c2d4e362dfdc4b05daa0a4e18814836 upstream.

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>
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/memremap.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/kernel/memremap.c
+++ b/kernel/memremap.c
@@ -133,8 +133,10 @@ void *devm_memremap(struct device *dev,
 	if (addr) {
 		*ptr = addr;
 		devres_add(dev, ptr);
-	} else
+	} else {
 		devres_free(ptr);
+		return ERR_PTR(-ENXIO);
+	}
 
 	return addr;
 }


Patches currently in stable-queue which might be from toshi.kani@hpe.com are

queue-4.4/devm_memremap-fix-error-value-when-memremap-failed.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-03-01  5:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-01  5:23 Patch "devm_memremap: Fix error value when memremap failed" has been added to the 4.4-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).