Data->devicefile can contain absolute path to target device, so we need to convert it to a device name before we can safely use it. Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx> --- arch/arm/mach-imx/imx-bbu-internal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-imx/imx-bbu-internal.c b/arch/arm/mach-imx/imx-bbu-internal.c index faa266572..14bc569b7 100644 --- a/arch/arm/mach-imx/imx-bbu-internal.c +++ b/arch/arm/mach-imx/imx-bbu-internal.c @@ -409,8 +409,9 @@ static int imx_bbu_internal_mmcboot_update(struct bbu_handler *handler, char *bootpartvar; const char *bootpart; char *devicefile; + const char *devname = devpath_to_name(data->devicefile); - ret = asprintf(&bootpartvar, "%s.boot", data->devicefile); + ret = asprintf(&bootpartvar, "%s.boot", devname); if (ret < 0) return ret; @@ -427,7 +428,7 @@ static int imx_bbu_internal_mmcboot_update(struct bbu_handler *handler, bootpart = "boot0"; } - ret = asprintf(&devicefile, "/dev/%s.%s", data->devicefile, bootpart); + ret = asprintf(&devicefile, "/dev/%s.%s", devname, bootpart); if (ret < 0) goto free_bootpartvar; -- 2.17.1 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox