X-Git-Url: https://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fgrub2%2Fgrub2.c;h=fb3d8668a99bdfa5334ff8f62e6b4e98904e4af3;hp=ebc6ac7b6d72383d24efc29a1c08bf11cf2b8d6f;hb=1513dd5d05f6408a64e19ea18cfaeb0cb8c5fb73;hpb=64899475f9b895628fd7b654f7b549e50494229a diff --git a/discover/grub2/grub2.c b/discover/grub2/grub2.c index ebc6ac7..fb3d866 100644 --- a/discover/grub2/grub2.c +++ b/discover/grub2/grub2.c @@ -31,14 +31,14 @@ static const char *const grub2_conf_files[] = { }; struct grub2_resource_info { - struct grub2_root *root; + char *root; char *path; }; /* we use slightly different resources for grub2 */ struct resource *create_grub2_resource(void *ctx, struct discover_device *orig_device, - struct grub2_root *root, const char *path) + const char *root, const char *path) { struct grub2_resource_info *info; struct resource *res; @@ -47,8 +47,8 @@ struct resource *create_grub2_resource(void *ctx, if (root) { info = talloc(res, struct grub2_resource_info); - info->root = root; talloc_reference(info, root); + info->root = talloc_strdup(info, root); info->path = talloc_strdup(info, path); res->resolved = false; @@ -68,7 +68,7 @@ bool resolve_grub2_resource(struct device_handler *handler, assert(!res->resolved); - dev = device_lookup_by_uuid(handler, info->root->uuid); + dev = device_lookup_by_uuid(handler, info->root); if (!dev) return false;