Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Mikulas Patocka and committed by
Mike Snitzer
81bc6d15 514cf4f8

+2 -1
+2 -1
drivers/md/dm-delay.c
··· 121 121 { 122 122 struct delay_c *dc = ti->private; 123 123 124 - destroy_workqueue(dc->kdelayd_wq); 124 + if (dc->kdelayd_wq) 125 + destroy_workqueue(dc->kdelayd_wq); 125 126 126 127 if (dc->read.dev) 127 128 dm_put_device(ti, dc->read.dev);