From b1166b42250645c14e6cfb799385b9d6dbd29820 Mon Sep 17 00:00:00 2001 From: Stanislaw Wadas Date: Thu, 13 Nov 2014 13:36:50 +0100 Subject: [PATCH] Fix problems with gadget enable Change-Id: I513f2ca9e012b0f2e22973aa49af7a4ae8493dab Signed-off-by: Stanislaw Wadas --- source/gadget/src/gadget.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/gadget/src/gadget.c b/source/gadget/src/gadget.c index 2d5a2dc..385425a 100644 --- a/source/gadget/src/gadget.c +++ b/source/gadget/src/gadget.c @@ -580,6 +580,12 @@ static int gt_gadget_enable_func(void *data) } } } + + if (l == NULL) { + fprintf(stderr, "Failed to enable gadget, no UDC found\n"); + return -1; + } + out: g_list_foreach(objects, (GFunc)g_object_unref, NULL); g_list_free(objects); @@ -611,7 +617,7 @@ out: usbg_ret = usbg_enable_gadget(g, udc); if (usbg_ret != USBG_SUCCESS) { - fprintf(stderr, "Failed to get gadget %s\n", usbg_strerror(usbg_ret)); + fprintf(stderr, "Failed to enable gadget %s\n", usbg_strerror(usbg_ret)); return -1; } } -- 2.7.4