From d04ef4c26d7799ea893f8407a40247eedb0ef58c Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Wed, 21 Nov 2001 14:52:16 +0000 Subject: [PATCH] o Don't use dmt->dmi until it has been initialised. --- libdm/libdm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libdm/libdm.c b/libdm/libdm.c index 16bb5aef7..fd6bccd39 100644 --- a/libdm/libdm.c +++ b/libdm/libdm.c @@ -172,7 +172,7 @@ int dm_task_add_target(struct dm_task *dmt, static void *_align(void *ptr, unsigned int align) { align--; - return (void *) (((long) ptr + align) & ~align); + return (void *) (((unsigned long) ptr + align) & ~align); } static void *_add_target(struct target *t, void *out, void *end) @@ -245,6 +245,8 @@ static struct dm_ioctl *_flatten(struct dm_task *dmt) if (!(b = _add_target(t, b, e))) goto bad; + fprintf(stderr, "dm_ioctl size = %lu\n", dmi->data_size); + return dmi; bad: @@ -397,7 +399,7 @@ int dm_task_run(struct dm_task *dmt) switch (dmt->type) { case DM_DEVICE_CREATE: - _add_dev_node(dmt->dev_name, dmt->dmi->minor); + _add_dev_node(dmt->dev_name, dmi->minor); break; case DM_DEVICE_REMOVE: