Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1431169
| From | Pavel Machek <pavel@ucw.cz> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/4][RFC v2] PM / sleep: Avoid accessing frozen_cpus if it is NULL |
| Date | 2016-06-25 19:00 +0200 |
| Message-ID | <rNZ61-7RB-5@gated-at.bofh.it> (permalink) |
| References | <rNYtj-7Eq-3@gated-at.bofh.it> <rNYtj-7Eq-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Sun 2016-06-26 00:18:30, Chen Yu wrote:
> frozen_cpus might be NULL if the allocation in previous
> alloc_frozen_cpus failed, when CONFIG_CPUMASK_OFFSTACK
> is set.
>
> This patch avoid accessing this cpumask if it is NULL.
>
> Signed-off-by: Chen Yu <yu.c.chen@intel.com>
> ---
> kernel/cpu.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/kernel/cpu.c b/kernel/cpu.c
> index d948e44..d25266e 100644
> --- a/kernel/cpu.c
> +++ b/kernel/cpu.c
> @@ -1021,6 +1021,8 @@ int disable_nonboot_cpus(void)
> {
> int cpu, first_cpu, error = 0;
>
> + if (frozen_cpus == NULL)
> + return -ENOMEM;
> cpu_maps_update_begin();
> first_cpu = cpumask_first(cpu_online_mask);
> /*
I'd say that whoever allocates frozen_cpus should just abort the
hibernation if there's not enough memory for the operation...? This
seems like checking for the problem too late.
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/4][RFC v2] x86, hotplug: Use hlt instead of mwait when resuming from hibernation Chen Yu <yu.c.chen@intel.com> - 2016-06-25 18:20 +0200
[PATCH 3/4][RFC v2] PM / hibernate: introduce a flag to indicate resuming from hibernation Chen Yu <yu.c.chen@intel.com> - 2016-06-25 18:20 +0200
Re: [PATCH 3/4][RFC v2] PM / hibernate: introduce a flag to indicate resuming from hibernation Pavel Machek <pavel@ucw.cz> - 2016-06-25 19:00 +0200
RE: [PATCH 3/4][RFC v2] PM / hibernate: introduce a flag to indicate resuming from hibernation "Chen, Yu C" <yu.c.chen@intel.com> - 2016-06-26 03:40 +0200
[PATCH 1/4][RFC v2] PM / sleep: Avoid accessing frozen_cpus if it is NULL Chen Yu <yu.c.chen@intel.com> - 2016-06-25 18:20 +0200
Re: [PATCH 1/4][RFC v2] PM / sleep: Avoid accessing frozen_cpus if it is NULL Pavel Machek <pavel@ucw.cz> - 2016-06-25 19:00 +0200
RE: [PATCH 1/4][RFC v2] PM / sleep: Avoid accessing frozen_cpus if it is NULL "Chen, Yu C" <yu.c.chen@intel.com> - 2016-06-26 03:20 +0200
RE: [PATCH 1/4][RFC v2] PM / sleep: Avoid accessing frozen_cpus if it is NULL "Chen, Yu C" <yu.c.chen@intel.com> - 2016-06-26 06:30 +0200
[PATCH 2/4][RFC v2] PM / sleep: Introduce arch-specific hook for disable/enable nonboot cpus Chen Yu <yu.c.chen@intel.com> - 2016-06-25 18:20 +0200
Re: [PATCH 2/4][RFC v2] PM / sleep: Introduce arch-specific hook for disable/enable nonboot cpus Pavel Machek <pavel@ucw.cz> - 2016-06-25 19:00 +0200
RE: [PATCH 2/4][RFC v2] PM / sleep: Introduce arch-specific hook for disable/enable nonboot cpus "Chen, Yu C" <yu.c.chen@intel.com> - 2016-06-26 03:20 +0200
csiph-web