提交 8440f4b1 编写于 作者: M Michal Kubecek 提交者: Rafael J. Wysocki

PM: Free memory bitmaps if opening /dev/snapshot fails

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: NMichal Kubecek <mkubecek@suse.cz>
Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
Cc: stable@kernel.org
上级 f76b168b
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册