summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-05-30 11:57:42 +0200
committerHans de Goede <hdegoede@redhat.com>2014-05-30 12:35:34 +0200
commit507f6c7bdaf7da136663721c392fc6deef16fa49 (patch)
tree4ce6513295da8ca05f067131b97ce6054abea823
parentd7e763e277db4ecafa66f20684ab751e680b0557 (diff)
downloadlibusb-507f6c7bdaf7da136663721c392fc6deef16fa49.tar.gz
linux_udev: Fix a Coverity warning
This really is a false positive, but easy enough to silence: *** CID 62578: Failure to restore non-local value (MISSING_RESTORE) /libusb/os/linux_udev.c: 64 in linux_udev_start_event_monitor() 58 int r; 59 60 assert(udev_ctx == NULL); 61 udev_ctx = udev_new(); 62 if (!udev_ctx) { 63 usbi_err(NULL, "could not create udev context"); >>> CID 62578: Failure to restore non-local value (MISSING_RESTORE) >>> Value of non-local "udev_ctx" that was verified to be "NULL" is not restored as it was along other paths. 64 return LIBUSB_ERROR_OTHER; 65 } 66 67 udev_monitor = udev_monitor_new_from_netlink(udev_ctx, "udev"); 68 if (!udev_monitor) { 69 usbi_err(NULL, "could not initialize udev monitor"); Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--libusb/os/linux_udev.c3
-rw-r--r--libusb/version_nano.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/libusb/os/linux_udev.c b/libusb/os/linux_udev.c
index 99ac943..0394048 100644
--- a/libusb/os/linux_udev.c
+++ b/libusb/os/linux_udev.c
@@ -61,7 +61,7 @@ int linux_udev_start_event_monitor(void)
udev_ctx = udev_new();
if (!udev_ctx) {
usbi_err(NULL, "could not create udev context");
- return LIBUSB_ERROR_OTHER;
+ goto err;
}
udev_monitor = udev_monitor_new_from_netlink(udev_ctx, "udev");
@@ -119,6 +119,7 @@ err_free_monitor:
udev_monitor_fd = -1;
err_free_ctx:
udev_unref(udev_ctx);
+err:
udev_ctx = NULL;
return LIBUSB_ERROR_OTHER;
}
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index f17ff97..c742cf2 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 10897
+#define LIBUSB_NANO 10898