[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <df051844-0a73-4cf9-9719-a6001f1c9d5c@moroto.mountain>
Date: Fri, 21 Jul 2023 17:57:00 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Michal Hocko <mhocko@...e.com>
Cc: Andy Shevchenko <andy@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Mel Gorman <mgorman@...e.de>, Vlastimil Babka <vbabka@...e.cz>,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [PATCH] lib/string_helpers: Use passed in GFP_ flags
This patch doesn't affect runtime because all the callers pass GFP_KERNEL
as the allocation flags. However, it should use the passed in "gfp" as
the allocation flags.
Fixes: 0ee931c4e31a ("mm: treewide: remove GFP_TEMPORARY allocation flag")
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
---
lib/string_helpers.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/string_helpers.c b/lib/string_helpers.c
index d3b1dd718daf..be517c25737d 100644
--- a/lib/string_helpers.c
+++ b/lib/string_helpers.c
@@ -668,7 +668,7 @@ char *kstrdup_quotable_cmdline(struct task_struct *task, gfp_t gfp)
char *buffer, *quoted;
int i, res;
- buffer = kmalloc(PAGE_SIZE, GFP_KERNEL);
+ buffer = kmalloc(PAGE_SIZE, gfp);
if (!buffer)
return NULL;
@@ -704,7 +704,7 @@ char *kstrdup_quotable_file(struct file *file, gfp_t gfp)
return kstrdup("<unknown>", gfp);
/* We add 11 spaces for ' (deleted)' to be appended */
- temp = kmalloc(PATH_MAX + 11, GFP_KERNEL);
+ temp = kmalloc(PATH_MAX + 11, gfp);
if (!temp)
return kstrdup("<no_memory>", gfp);
--
2.39.2
Powered by blists - more mailing lists