public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PM/Hibernate: Enable usermodehelpers in hibernate() error path
@ 2012-02-16 12:23 Srivatsa S. Bhat
  2012-02-17 22:52 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Srivatsa S. Bhat @ 2012-02-16 12:23 UTC (permalink / raw)
  To: rjw; +Cc: pavel, len.brown, linux-pm, linux-kernel, srivatsa.bhat

If create_basic_memory_bitmaps() fails, usermodehelpers are not re-enabled
before returning. Fix this. And while at it, reword the goto labels so that
they look more meaningful.

Cc: stable@vger.kernel.org
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
---

 kernel/power/hibernate.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index 72baaf0..0a186cf 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -618,7 +618,7 @@ int hibernate(void)
 	/* Allocate memory management structures */
 	error = create_basic_memory_bitmaps();
 	if (error)
-		goto Exit;
+		goto Enable_umh;
 
 	printk(KERN_INFO "PM: Syncing filesystems ... ");
 	sys_sync();
@@ -626,7 +626,7 @@ int hibernate(void)
 
 	error = freeze_processes();
 	if (error)
-		goto Finish;
+		goto Free_bitmaps;
 
 	error = hibernation_snapshot(hibernation_mode == HIBERNATION_PLATFORM);
 	if (error || freezer_test_done)
@@ -659,8 +659,9 @@ int hibernate(void)
 	/* Don't bother checking whether freezer_test_done is true */
 	freezer_test_done = false;
 
- Finish:
+ Free_bitmaps:
 	free_basic_memory_bitmaps();
+ Enable_umh:
 	usermodehelper_enable();
  Exit:
 	pm_notifier_call_chain(PM_POST_HIBERNATION);


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

* Re: [PATCH] PM/Hibernate: Enable usermodehelpers in hibernate() error path
  2012-02-16 12:23 [PATCH] PM/Hibernate: Enable usermodehelpers in hibernate() error path Srivatsa S. Bhat
@ 2012-02-17 22:52 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2012-02-17 22:52 UTC (permalink / raw)
  To: Srivatsa S. Bhat; +Cc: pavel, len.brown, linux-pm, linux-kernel

On Thursday, February 16, 2012, Srivatsa S. Bhat wrote:
> If create_basic_memory_bitmaps() fails, usermodehelpers are not re-enabled
> before returning. Fix this. And while at it, reword the goto labels so that
> they look more meaningful.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>

Applied, thanks for catching this!

Rafael


> ---
> 
>  kernel/power/hibernate.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
> index 72baaf0..0a186cf 100644
> --- a/kernel/power/hibernate.c
> +++ b/kernel/power/hibernate.c
> @@ -618,7 +618,7 @@ int hibernate(void)
>  	/* Allocate memory management structures */
>  	error = create_basic_memory_bitmaps();
>  	if (error)
> -		goto Exit;
> +		goto Enable_umh;
>  
>  	printk(KERN_INFO "PM: Syncing filesystems ... ");
>  	sys_sync();
> @@ -626,7 +626,7 @@ int hibernate(void)
>  
>  	error = freeze_processes();
>  	if (error)
> -		goto Finish;
> +		goto Free_bitmaps;
>  
>  	error = hibernation_snapshot(hibernation_mode == HIBERNATION_PLATFORM);
>  	if (error || freezer_test_done)
> @@ -659,8 +659,9 @@ int hibernate(void)
>  	/* Don't bother checking whether freezer_test_done is true */
>  	freezer_test_done = false;
>  
> - Finish:
> + Free_bitmaps:
>  	free_basic_memory_bitmaps();
> + Enable_umh:
>  	usermodehelper_enable();
>   Exit:
>  	pm_notifier_call_chain(PM_POST_HIBERNATION);
> 
> 
> 


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

end of thread, other threads:[~2012-02-17 22:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-16 12:23 [PATCH] PM/Hibernate: Enable usermodehelpers in hibernate() error path Srivatsa S. Bhat
2012-02-17 22:52 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox