am7xxx: silent a warning enabled by 'sparse' about an uninitialized variable
authorAntonio Ospite <ospite@studenti.unina.it>
Tue, 28 Feb 2012 20:44:34 +0000 (21:44 +0100)
committerAntonio Ospite <ospite@studenti.unina.it>
Wed, 29 Feb 2012 22:43:06 +0000 (23:43 +0100)
src/am7xxx.c:423:6: warning: ‘ret’ may be used uninitialized in this function [-Wuninitialized]

If libusb_get_device_list() returned 0 we didn't have 'ret' properly
initialized.

src/am7xxx.c

index 114027e..11c259d 100644 (file)
@@ -464,6 +464,8 @@ static int scan_devices(am7xxx_context *ctx, scan_op op,
                goto out;
        }
 
+       /* everything went fine when building the device list */
+       ret = 0;
 out:
        libusb_free_device_list(list, 1);
        return ret;