mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>
Subject: [PATCH 2/4] drivers/base/devtmpfs.c: don't pretend path is const in delete_path
Date: Wed, 22 Aug 2018 13:00:07 +0200	[thread overview]
Message-ID: <20180822110009.17583-2-linux@rasmusvillemoes.dk> (raw)
In-Reply-To: <20180822110009.17583-1-linux@rasmusvillemoes.dk>

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>
---
 drivers/base/devtmpfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
index f7768077e817..b93fc862d365 100644
--- a/drivers/base/devtmpfs.c
+++ b/drivers/base/devtmpfs.c
@@ -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);
-- 
2.16.4


  reply	other threads:[~2018-08-22 11:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-22 11:00 [PATCH 1/4] string: try to find const-laundering bugs Rasmus Villemoes
2018-08-22 11:00 ` Rasmus Villemoes [this message]
2018-08-22 11:00 ` [PATCH 3/4] lib/, include/: avoid const-laundering warnings Rasmus Villemoes
2018-08-22 11:00 ` [PATCH 4/4] kernel/, init/: " Rasmus Villemoes
2018-08-22 11:07 ` [PATCH 1/4] string: try to find const-laundering bugs Joe Perches
2018-08-22 11:40   ` Rasmus Villemoes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180822110009.17583-2-linux@rasmusvillemoes.dk \
    --to=linux@rasmusvillemoes.dk \
    --cc=gregkh@linuxfoundation.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®