For configuration where DFU is disabled, opts->dfu_opts.files would
contain the system partitions and multi-gadget auto start would
fail. Ignore dfu == true when support is not compiled in.

Signed-off-by: Ahmad Fatoum <[email protected]>
---
 common/usbgadget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/usbgadget.c b/common/usbgadget.c
index bdbb4d794889..489b3b801630 100644
--- a/common/usbgadget.c
+++ b/common/usbgadget.c
@@ -53,7 +53,7 @@ int usbgadget_register(bool dfu, const char *dfu_opts,
        opts = xzalloc(sizeof(*opts));
        opts->release = usb_multi_opts_release;
 
-       if (dfu)
+       if (IS_ENABLED(CONFIG_USB_GADGET_DFU) && dfu)
                opts->dfu_opts.files = dfu_opts ? parse(dfu_opts)
                        : get_dfu_function();
 
-- 
2.29.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to