]> git.karo-electronics.de Git - karo-tx-linux.git/commit
PM: Free memory bitmaps if opening /dev/snapshot fails
authorMichal Kubecek <mkubecek@suse.cz>
Sat, 18 Jun 2011 18:34:01 +0000 (20:34 +0200)
committerAndi Kleen <ak@linux.intel.com>
Mon, 1 Aug 2011 20:54:57 +0000 (13:54 -0700)
commit50a771dfdad39b55910eb18c08c8a789b1281a59
treee9d1b16b84e5f6e19f3bba2d5f8457df02930fd3
parentfe2a1e38b67ce3138ed85fc7c55a044f0da4d560
PM: Free memory bitmaps if opening /dev/snapshot fails

commit 8440f4b19494467883f8541b7aa28c7bbf6ac92b upstream.

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>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
kernel/power/user.c