All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PM/hibernate: fix __setup handler error handling
@ 2022-02-28 22:05 Randy Dunlap
  2022-03-01 17:51 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2022-02-28 22:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Igor Zhbanov, Fabian Frederick, Andrew Morton,
	Rafael J. Wysocki, Pavel Machek, linux-pm, Len Brown

If an invalid value is used in "resumedelay=<seconds>", it is
silently ignored. Add a warning message and then let the __setup
handler return 1 to indicate that the kernel command line option
has been handled.

Fixes: 317cf7e5e85e3 ("PM / hibernate: convert simple_strtoul to kstrtoul")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: Igor Zhbanov <i.zhbanov@omprussia.ru>
Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru
Cc: Fabian Frederick <fabf@skynet.be>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: linux-pm@vger.kernel.org
Cc: Len Brown <len.brown@intel.com>
---
 kernel/power/hibernate.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20220228.orig/kernel/power/hibernate.c
+++ linux-next-20220228/kernel/power/hibernate.c
@@ -1329,7 +1329,7 @@ static int __init resumedelay_setup(char
 	int rc = kstrtouint(str, 0, &resume_delay);
 
 	if (rc)
-		return rc;
+		pr_warn("resumedelay: bad option string '%s'\n", str);
 	return 1;
 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] PM/hibernate: fix __setup handler error handling
  2022-02-28 22:05 [PATCH] PM/hibernate: fix __setup handler error handling Randy Dunlap
@ 2022-03-01 17:51 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2022-03-01 17:51 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Linux Kernel Mailing List, Igor Zhbanov, Fabian Frederick,
	Andrew Morton, Rafael J. Wysocki, Pavel Machek, Linux PM,
	Len Brown

On Mon, Feb 28, 2022 at 11:05 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> If an invalid value is used in "resumedelay=<seconds>", it is
> silently ignored. Add a warning message and then let the __setup
> handler return 1 to indicate that the kernel command line option
> has been handled.
>
> Fixes: 317cf7e5e85e3 ("PM / hibernate: convert simple_strtoul to kstrtoul")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: Igor Zhbanov <i.zhbanov@omprussia.ru>
> Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru
> Cc: Fabian Frederick <fabf@skynet.be>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: linux-pm@vger.kernel.org
> Cc: Len Brown <len.brown@intel.com>
> ---
>  kernel/power/hibernate.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- linux-next-20220228.orig/kernel/power/hibernate.c
> +++ linux-next-20220228/kernel/power/hibernate.c
> @@ -1329,7 +1329,7 @@ static int __init resumedelay_setup(char
>         int rc = kstrtouint(str, 0, &resume_delay);
>
>         if (rc)
> -               return rc;
> +               pr_warn("resumedelay: bad option string '%s'\n", str);
>         return 1;
>  }

Applied as 5.18 material, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-01 17:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-28 22:05 [PATCH] PM/hibernate: fix __setup handler error handling Randy Dunlap
2022-03-01 17:51 ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.