DBG(ASK, ul_debug("%s: asking for %s partition number "
"(max: %zu, inchar: %s)",
- cxt->label->name,
+ cxt->label ? cxt->label->name : "???",
wantnew ? "new" : "used",
- cxt->label->nparts_max,
+ cxt->label ? cxt->label->nparts_max : 0,
inchar ? "yes" : "not"));
ask = fdisk_new_ask();
return -ENOSYS;
__fdisk_switch_label(cxt, lb);
+ assert(cxt->label == lb);
if (haslabel && !cxt->parent)
fdisk_reset_device_properties(cxt);
DBG(CXT, ul_debugobj(cxt, "create a new %s label", lb->name));
- return cxt->label->op->create(cxt);
+ return lb->op->create(cxt);
}
/**