mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [linux-pm] [PATCH 3.0-rc3] PM: free memory bitmaps if opening /dev/snapshot fails
       [not found] <20110617175231.A80284030A@alaris.suse.cz>
@ 2011-06-18 20:44 ` Rafael J. Wysocki
  0 siblings, 0 replies; only message in thread
From: Rafael J. Wysocki @ 2011-06-18 20:44 UTC (permalink / raw)
  To: Michal Kubecek; +Cc: linux-pm, LKML

On Friday, June 17, 2011, Michal Kubecek wrote:
> From: Michal Kubecek <mkubecek@suse.cz>
> 
> When opening /dev/snapshot device, snapshot_open() creates memory
> bitmaps which are freed in snapshot_release(). But if any of the
> callbacks called by pm_notifier_call_chain() returns NOTIFY_BAD, open()
> fails, snapshot_release() is never called and bitmaps are not freed.
> Next attempt to open /dev/snapshot then triggers BUG_ON() check in
> create_basic_memory_bitmaps(). This happens e.g. when vmwatchdog module
> is active on s390x.
> 
> Signed-off-by: Michal Kubecek <mkubecek@suse.cz>

Thanks, I'm going to push your patch for 3.0 + stable.

Rafael


> --- 
> 
> diff --git a/kernel/power/user.c b/kernel/power/user.c
> index 7d02d33..42ddbc6 100644
> --- a/kernel/power/user.c
> +++ b/kernel/power/user.c
> @@ -113,8 +113,10 @@ static int snapshot_open(struct inode *inode, struct file *filp)
>  		if (error)
>  			pm_notifier_call_chain(PM_POST_RESTORE);
>  	}
> -	if (error)
> +	if (error) {
> +		free_basic_memory_bitmaps();
>  		atomic_inc(&snapshot_device_available);
> +	}
>  	data->frozen = 0;
>  	data->ready = 0;
>  	data->platform_support = 0;
> _______________________________________________
> linux-pm mailing list
> linux-pm@lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/linux-pm
> 
> 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-06-18 20:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20110617175231.A80284030A@alaris.suse.cz>
2011-06-18 20:44 ` [linux-pm] [PATCH 3.0-rc3] PM: free memory bitmaps if opening /dev/snapshot fails 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

all inboxes | Powered by JetHome®