From 53f2c8a6bfa77a2bb17181c76873427a98891617 Mon Sep 17 00:00:00 2001 From: Michal Bloch Date: Mon, 19 Nov 2018 15:04:05 +0100 Subject: Fix some static analysis warnings. Change-Id: I632bd9813094ade3b03dadd7d21bc62dc2152710 Signed-off-by: Michal Bloch --- hw/usb_cfs_client_common.c | 5 +---- src/device-node.c | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/usb_cfs_client_common.c b/hw/usb_cfs_client_common.c index 8069f4d..1982283 100644 --- a/hw/usb_cfs_client_common.c +++ b/hw/usb_cfs_client_common.c @@ -780,15 +780,12 @@ static int cfs_reconfigure_gadget(struct usb_client *usb, int i; int ret; - if (!usb) + if (!usb || !gadget || !cfs_is_gadget_supported(usb, gadget)) return -EINVAL; cfs_client = container_of(usb, struct cfs_client, client); - if (!usb || !gadget || !cfs_is_gadget_supported(usb, gadget)) - return -EINVAL; - ret = cfs_set_gadget_attrs(cfs_client, &gadget->attrs); if (ret) goto out; diff --git a/src/device-node.c b/src/device-node.c index 3000a76..ed7c8ea 100644 --- a/src/device-node.c +++ b/src/device-node.c @@ -141,6 +141,9 @@ static void __CONSTRUCTOR__ module_init(void) if ((error = dlerror()) != NULL) { _E("dlsym() failed: %s", error); goto ERROR; + } else if (OEM_sys_get_devman_plugin_interface == NULL) { + _E("dlsym(): symbol \"OEM_sys_get_devman_plugin_interface\" missing from %s", DEVMAN_PLUGIN_PATH); + goto ERROR; } oem_intf = OEM_sys_get_devman_plugin_interface(); -- cgit v1.2.3