diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2019-04-25 18:07:54 +0200 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2019-04-26 17:29:32 +0200 |
commit | 81bc6d150ace6250503b825d9d0c10f7bbd24095 (patch) | |
tree | 417973021a7554627ba93b791c98fede30a5c0cb /drivers/md/dm-delay.c | |
parent | dm: only initialize md->dax_dev if CONFIG_DAX_DRIVER is enabled (diff) | |
download | linux-81bc6d150ace6250503b825d9d0c10f7bbd24095.tar.xz linux-81bc6d150ace6250503b825d9d0c10f7bbd24095.zip |
dm delay: fix a crash when invalid device is specified
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>
Diffstat (limited to 'drivers/md/dm-delay.c')
-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 fddffe251bf6..f496213f8b67 100644 --- a/drivers/md/dm-delay.c +++ b/drivers/md/dm-delay.c @@ -121,7 +121,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); if (dc->read.dev) dm_put_device(ti, dc->read.dev); |