udev-builtin: path_id - don't pass NULL to udev_device_get_parent()
authorTom Gundersen <teg@jklm.no>
Tue, 2 Jun 2015 14:53:36 +0000 (16:53 +0200)
committerTom Gundersen <teg@jklm.no>
Tue, 2 Jun 2015 16:12:47 +0000 (18:12 +0200)
Being explicit about this makes the code easier to follow IMHO.

src/udev/udev-builtin-path_id.c

index 0fa11f6..4ca0a69 100644 (file)
@@ -665,7 +665,8 @@ static int builtin_path_id(struct udev_device *dev, int argc, char *argv[], bool
                         supported_parent = true;
                 }
 
-                parent = udev_device_get_parent(parent);
+                if (parent)
+                        parent = udev_device_get_parent(parent);
         }
 
         /*