mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 16:37:50 +00:00
dm delay: fix a crash when invalid device is specified
commit 81bc6d150a
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: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
fc6d84abd8
commit
9da66c87fd
1 changed files with 2 additions and 1 deletions
|
@ -222,6 +222,7 @@ static void delay_dtr(struct dm_target *ti)
|
||||||
{
|
{
|
||||||
struct delay_c *dc = ti->private;
|
struct delay_c *dc = ti->private;
|
||||||
|
|
||||||
|
if (dc->kdelayd_wq)
|
||||||
destroy_workqueue(dc->kdelayd_wq);
|
destroy_workqueue(dc->kdelayd_wq);
|
||||||
|
|
||||||
dm_put_device(ti, dc->dev_read);
|
dm_put_device(ti, dc->dev_read);
|
||||||
|
|
Loading…
Reference in a new issue