[Devel] [PATCH hci-8.1 v5 2/7] drivers/md/push_backup: return error if workqueue allocation fails
Andrey Zhadchenko
andrey.zhadchenko at virtuozzo.com
Tue Nov 3 15:37:57 MSK 2026
ret is still 0 from dm_get_device() when alloc_ordered_workqueue()
fails, so pb_ctr() frees pb and returns success. The table keeps
ti->private pointing to freed memory, and pb_dtr() destroys it a
second time.
Fixes: 62e07487348e ("dm: Add push backup driver")
https://virtuozzo.atlassian.net/browse/VSTOR-152912
Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko at virtuozzo.com>
---
v5: new patch
drivers/md/dm-push-backup.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/md/dm-push-backup.c b/drivers/md/dm-push-backup.c
index 9a6252f2b21e2..48d6d6a59daf4 100644
--- a/drivers/md/dm-push-backup.c
+++ b/drivers/md/dm-push-backup.c
@@ -698,6 +698,7 @@ static int pb_ctr(struct dm_target *ti, unsigned int argc, char **argv)
pb->wq = alloc_ordered_workqueue("dm-" DM_MSG_PREFIX, WQ_MEM_RECLAIM);
if (!pb->wq) {
+ ret = -ENOMEM;
ti->error = "could not create workqueue for metadata object";
goto err;
}
--
2.43.5
More information about the Devel
mailing list