]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
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 0fa11f623087d962161dd4032fb04f054b42b9f9..4ca0a69d7dbefe66c30b0b8d0f0d28b78d1a0250 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);
         }
 
         /*