diff mbox series

[1/3] lib/string: Pass the input gfp flags to kmalloc

Message ID 1539334616-11723-2-git-send-email-smasetty@codeaurora.org (mailing list archive)
State Not Applicable, archived
Delegated to: Andy Gross
Headers show
Series drm/msm: Fix gpu recovery path | expand

Commit Message

Sharat Masetty Oct. 12, 2018, 8:56 a.m. UTC
Pass the user sent gfp flags to kmalloc() calls. This helps calling the
functions in user desired contexts.

Signed-off-by: Sharat Masetty <smasetty@codeaurora.org>
---
 lib/string_helpers.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Rob Clark Oct. 12, 2018, 1:02 p.m. UTC | #1
Thanks, I've pushed 2 and 3 to msm-next, since these should probably
go in a -fixes pr for 4.20

This one, you might want to resend w/
--cc-cmd=./scripts/get_maintainer.pl so that it gets seen by someone
who could apply it

fwiw, I use

  git config sendemail.cccmd './scripts/get_maintainer.pl -i'

to make that automatic, but to give me a way to edit the list of cc's
that get_maintainer.pl adds

BR,
-R

On Fri, Oct 12, 2018 at 4:57 AM Sharat Masetty <smasetty@codeaurora.org> wrote:
>
> Pass the user sent gfp flags to kmalloc() calls. This helps calling the
> functions in user desired contexts.
>
> Signed-off-by: Sharat Masetty <smasetty@codeaurora.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 29c490e..60f9015 100644
> --- a/lib/string_helpers.c
> +++ b/lib/string_helpers.c
> @@ -576,7 +576,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;
>
> @@ -612,7 +612,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);
>
> --
> 1.9.1
>
> _______________________________________________
> Freedreno mailing list
> Freedreno@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/freedreno
diff mbox series

Patch

diff --git a/lib/string_helpers.c b/lib/string_helpers.c
index 29c490e..60f9015 100644
--- a/lib/string_helpers.c
+++ b/lib/string_helpers.c
@@ -576,7 +576,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;
 
@@ -612,7 +612,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);