device: avoid null pointer dereference
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Wed, 6 May 2015 17:56:29 +0000 (19:56 +0200)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Wed, 6 May 2015 17:58:03 +0000 (19:58 +0200)
src/core/device.c

index 2c56c5a..c09ea6c 100644 (file)
@@ -310,7 +310,7 @@ static int device_setup_unit(Manager *m, struct udev_device *dev, const char *pa
 
         r = unit_name_from_path(path, ".device", &e);
         if (r < 0)
-                return log_unit_error_errno(u->id, r, "Failed to generate device name: %m");
+                return log_error_errno(r, "Failed to generate unit name from device path: %m");
 
         u = manager_get_unit(m, e);