[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK7LNATn62wLjwEFSVESRNXJAVHkcJ2hFFPbR8xbVHjXwONrcw@mail.gmail.com>
Date: Thu, 17 Oct 2019 09:00:52 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: Denis Efremov <efremov@...ux.com>
Cc: Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Michal Marek <michal.lkml@...kovi.net>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] modpost: add NOFAIL to strdup call
On Tue, Oct 15, 2019 at 3:49 PM Denis Efremov <efremov@...ux.com> wrote:
>
> Add NOFAIL check for the strdup call, since the function
> allocates memory and can return NULL. All strdup calls in
> modpost are checked with NOFAIL.
>
> Signed-off-by: Denis Efremov <efremov@...ux.com>
> ---
> scripts/mod/modpost.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index 936d3ad23c83..8e8975065cbc 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -384,7 +384,7 @@ static struct symbol *sym_add_exported(const char *name, const char *namespace,
> }
> }
> free(s->namespace);
> - s->namespace = namespace ? strdup(namespace) : NULL;
> + s->namespace = namespace ? NOFAIL(strdup(namespace)) : NULL;
This is correct, but I will put it off
because otherwise if would cause a conflict against this patch:
https://lore.kernel.org/patchwork/patch/1138151/
That patch is adding NOFAIL().
> s->preloaded = 0;
> s->vmlinux = is_vmlinux(mod->name);
> s->kernel = 0;
> --
> 2.21.0
>
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists