提交 a5decf54 编写于 作者: M Mikulas Patocka 提交者: Xie XiuQi

dm delay: fix a crash when invalid device is specified

commit 81bc6d15 upstream.

When the target line contains an invalid device, delay_ctr() will call
delay_dtr() with NULL workqueue.  Attempting to destroy the NULL
workqueue causes a crash.
Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: NMike Snitzer <snitzer@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 08d2756e
...@@ -121,7 +121,8 @@ static void delay_dtr(struct dm_target *ti) ...@@ -121,7 +121,8 @@ static void delay_dtr(struct dm_target *ti)
{ {
struct delay_c *dc = ti->private; struct delay_c *dc = ti->private;
destroy_workqueue(dc->kdelayd_wq); if (dc->kdelayd_wq)
destroy_workqueue(dc->kdelayd_wq);
if (dc->read.dev) if (dc->read.dev)
dm_put_device(ti, dc->read.dev); dm_put_device(ti, dc->read.dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册