1 From 81bc6d150ace6250503b825d9d0c10f7bbd24095 Mon Sep 17 00:00:00 2001
2 From: Mikulas Patocka <mpatocka@redhat.com>
3 Date: Thu, 25 Apr 2019 12:07:54 -0400
4 Subject: dm delay: fix a crash when invalid device is specified
6 From: Mikulas Patocka <mpatocka@redhat.com>
8 commit 81bc6d150ace6250503b825d9d0c10f7bbd24095 upstream.
10 When the target line contains an invalid device, delay_ctr() will call
11 delay_dtr() with NULL workqueue. Attempting to destroy the NULL
12 workqueue causes a crash.
14 Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
15 Cc: stable@vger.kernel.org
16 Signed-off-by: Mike Snitzer <snitzer@redhat.com>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 drivers/md/dm-delay.c | 3 ++-
21 1 file changed, 2 insertions(+), 1 deletion(-)
23 --- a/drivers/md/dm-delay.c
24 +++ b/drivers/md/dm-delay.c
25 @@ -121,7 +121,8 @@ static void delay_dtr(struct dm_target *
27 struct delay_c *dc = ti->private;
29 - destroy_workqueue(dc->kdelayd_wq);
31 + destroy_workqueue(dc->kdelayd_wq);
34 dm_put_device(ti, dc->read.dev);