drivers/base/devtmpfs.c: don't pretend path is const in delete_path
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Wed, 22 Aug 2018 11:00:07 +0000 (13:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Sep 2018 20:37:16 +0000 (22:37 +0200)
path is the result of kstrdup, and we repeatedly call strrchr on it,
modifying it through the returned pointer. So there's no reason to
pretend path is const.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/devtmpfs.c

index f776807..b93fc86 100644 (file)
@@ -252,7 +252,7 @@ static int dev_rmdir(const char *name)
 
 static int delete_path(const char *nodepath)
 {
-       const char *path;
+       char *path;
        int err = 0;
 
        path = kstrdup(nodepath, GFP_KERNEL);