diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2019-04-25 12:07:54 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-25 18:26:54 +0200 |
commit | 1f4195f9e78f452cf042844bc5a14174347185a9 (patch) | |
tree | ea6451fbfd94dabb751ea2eaa3d87687448d5934 | |
parent | d0a3f25d63855d37d453ca009483aeae08b1c1dc (diff) | |
download | linux-stable-1f4195f9e78f452cf042844bc5a14174347185a9.tar.gz linux-stable-1f4195f9e78f452cf042844bc5a14174347185a9.tar.bz2 linux-stable-1f4195f9e78f452cf042844bc5a14174347185a9.zip |
dm delay: fix a crash when invalid device is specified
commit 81bc6d150ace6250503b825d9d0c10f7bbd24095 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>
-rw-r--r-- | drivers/md/dm-delay.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/dm-delay.c b/drivers/md/dm-delay.c index cc70871a6d29..3f01c5229e69 100644 --- a/drivers/md/dm-delay.c +++ b/drivers/md/dm-delay.c @@ -222,7 +222,8 @@ static void delay_dtr(struct dm_target *ti) { struct delay_c *dc = ti->private; - destroy_workqueue(dc->kdelayd_wq); + if (dc->kdelayd_wq) + destroy_workqueue(dc->kdelayd_wq); dm_put_device(ti, dc->dev_read); |