* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
int cfg, void *opaque, const void *match_data,
hwaddr kernel_end, Error **errp)
{
+ Error *err = NULL;
const char *name;
const void *data;
const void *load_data;
hwaddr load_addr;
- int img_off, err;
+ int img_off;
size_t sz;
int ret;
return -EINVAL;
}
- err = fit_image_addr(itb, img_off, "load", &load_addr, errp);
- if (err == -ENOENT) {
+ ret = fit_image_addr(itb, img_off, "load", &load_addr, &err);
+ if (ret == -ENOENT) {
load_addr = ROUND_UP(kernel_end, 64 * KiB) + (10 * MiB);
- error_free(*errp);
- } else if (err) {
- error_prepend(errp, "unable to read FDT load address from FIT: ");
- ret = err;
+ error_free(err);
+ } else if (ret) {
+ error_propagate_prepend(errp, err,
+ "unable to read FDT load address from FIT: ");
goto out;
}