From: Joe Thornber Date: Wed, 21 Nov 2001 14:52:16 +0000 (+0000) Subject: o Don't use dmt->dmi until it has been initialised. X-Git-Tag: beta1-pre1~92 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=afa2202fae2bcd2659ea5776ec1b78ffcc6bfdd0;p=dm.git o Don't use dmt->dmi until it has been initialised. --- diff --git a/lib/libdm.c b/lib/libdm.c index 16bb5ae..fd6bccd 100644 --- a/lib/libdm.c +++ b/lib/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: