Fix some static analysis warnings. 71/193371/1
authorMichal Bloch <m.bloch@samsung.com>
Mon, 19 Nov 2018 14:04:05 +0000 (15:04 +0100)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Tue, 20 Nov 2018 02:35:57 +0000 (02:35 +0000)
Change-Id: I632bd9813094ade3b03dadd7d21bc62dc2152710
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
(cherry picked from commit 53f2c8a6bfa77a2bb17181c76873427a98891617)

hw/usb_cfs_client_common.c
src/device-node.c

index 8069f4dc27fde703d15662177ec1db25a152e269..1982283410b0b0759a1d963242a55628aacb64e5 100644 (file)
@@ -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;
index 3000a76571ee247c3122c330627744c06fde6830..ed7c8ea7abbd0ec4aafde52b689362e4a7fced83 100644 (file)
@@ -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();