linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/mmap: Tighten up cmdline_parse_stack_guard_gap()
Date: Tue, 29 Aug 2023 13:51:27 +0100	[thread overview]
Message-ID: <ZO3pz+3fAihhrtMU@casper.infradead.org> (raw)
In-Reply-To: <20230828052212.748872-1-anshuman.khandual@arm.com>

On Mon, Aug 28, 2023 at 10:52:12AM +0530, Anshuman Khandual wrote:
> -static int __init cmdline_parse_stack_guard_gap(char *p)
> +static int __init cmdline_parse_stack_guard_gap(char *str)
>  {
>  	unsigned long val;
> -	char *endptr;
>  
> -	val = simple_strtoul(p, &endptr, 10);
> -	if (!*endptr)
> -		stack_guard_gap = val << PAGE_SHIFT;
> +	if (!str)
> +		return 0;

Please explain how this function can be called with a NULL pointer.

> -	return 1;
> +	val = simple_strtoul(str, &str, 10);
> +	if (!*str && val) {
> +		stack_guard_gap = val << PAGE_SHIFT;
> +		return 1;
> +	}
> +	return 0;
>  }

Now you've removed the abillity for someone to say stack_guard_gap=0,
which seems potentially useful.


  reply	other threads:[~2023-08-29 12:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-28  5:22 Anshuman Khandual
2023-08-29 12:51 ` Matthew Wilcox [this message]
2023-08-30  3:17   ` Anshuman Khandual
2023-08-30  3:24     ` Matthew Wilcox

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=ZO3pz+3fAihhrtMU@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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